[pypy-commit] pypy unsigned-dtypes: fix annotator problem dealing with comparison functions

justinpeel noreply at buildbot.pypy.org
Sun Sep 25 08:45:05 CEST 2011


Author: Justin Peel <notmuchtotell at gmail.com>
Branch: unsigned-dtypes
Changeset: r47594:db53a3ddf28b
Date: 2011-09-25 00:44 -0600
http://bitbucket.org/pypy/pypy/changeset/db53a3ddf28b/

Log:	fix annotator problem dealing with comparison functions

diff --git a/pypy/module/micronumpy/interp_ufuncs.py b/pypy/module/micronumpy/interp_ufuncs.py
--- a/pypy/module/micronumpy/interp_ufuncs.py
+++ b/pypy/module/micronumpy/interp_ufuncs.py
@@ -254,7 +254,9 @@
         def impl(res_dtype, lvalue, rvalue):
             res = getattr(res_dtype, op_name)(lvalue, rvalue)
             if comparison_func:
-                res = space.fromcache(interp_dtype.W_BoolDtype).box(res)
+                booldtype = space.fromcache(interp_dtype.W_BoolDtype)
+                assert isinstance(booldtype, interp_dtype.W_BoolDtype)
+                res = booldtype.box(res)
             return res
     return func_with_new_name(impl, ufunc_name)
 


More information about the pypy-commit mailing list