Author: Brian Kearns <[email protected]>
Branch: numpy-refactor
Changeset: r69483:328438b28770
Date: 2014-02-26 18:46 -0500
http://bitbucket.org/pypy/pypy/changeset/328438b28770/
Log: fix test_compile
diff --git a/pypy/module/micronumpy/compile.py
b/pypy/module/micronumpy/compile.py
--- a/pypy/module/micronumpy/compile.py
+++ b/pypy/module/micronumpy/compile.py
@@ -1,4 +1,3 @@
-
""" This is a set of tools for standalone compiling of numpy expressions.
It should not be imported by the module itself
"""
@@ -95,7 +94,10 @@
return StringObject(NonConstant('foo'))
def isinstance_w(self, w_obj, w_tp):
- return w_obj.tp == w_tp
+ try:
+ return w_obj.tp == w_tp
+ except AttributeError:
+ return False
def decode_index4(self, w_idx, size):
if isinstance(w_idx, IntObject):
@@ -215,7 +217,8 @@
def lookup(self, w_obj, name):
w_type = self.type(w_obj)
- return w_type.lookup(name)
+ if not self.is_none(w_type):
+ return w_type.lookup(name)
def gettypefor(self, w_obj):
return W_TypeObject(w_obj.typedef.name)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit