[pypy-commit] pypy kill-someobject: fix micornumpy
fijal
noreply at buildbot.pypy.org
Fri Oct 12 15:32:51 CEST 2012
Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: kill-someobject
Changeset: r58031:c4839889e18f
Date: 2012-10-12 14:48 +0200
http://bitbucket.org/pypy/pypy/changeset/c4839889e18f/
Log: fix micornumpy
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
@@ -65,6 +65,9 @@
def _freeze_(self):
return True
+ def is_none(self, w_obj):
+ return w_obj is None or w_obj is self.w_None
+
def issequence_w(self, w_obj):
return isinstance(w_obj, ListObject) or isinstance(w_obj, W_NDimArray)
diff --git a/pypy/module/micronumpy/interp_dtype.py b/pypy/module/micronumpy/interp_dtype.py
--- a/pypy/module/micronumpy/interp_dtype.py
+++ b/pypy/module/micronumpy/interp_dtype.py
@@ -2,7 +2,7 @@
import sys
from pypy.interpreter.baseobjspace import Wrappable
from pypy.interpreter.error import OperationError
-from pypy.interpreter.gateway import interp2app, unwrap_spec, is_none
+from pypy.interpreter.gateway import interp2app, unwrap_spec
from pypy.interpreter.typedef import (TypeDef, GetSetProperty,
interp_attrproperty, interp_attrproperty_w)
from pypy.module.micronumpy import types, interp_boxes
@@ -19,7 +19,7 @@
UNICODELTR = 'U'
def decode_w_dtype(space, w_dtype):
- if is_none(space, w_dtype):
+ if space.is_none(w_dtype):
return None
return space.interp_w(W_Dtype,
space.call_function(space.gettypefor(W_Dtype), w_dtype))
@@ -208,7 +208,7 @@
def descr__new__(space, w_subtype, w_dtype):
cache = get_dtype_cache(space)
- if is_none(space, w_dtype):
+ if space.is_none(w_dtype):
return cache.w_float64dtype
elif space.isinstance_w(w_dtype, w_subtype):
return w_dtype
diff --git a/pypy/module/micronumpy/interp_support.py b/pypy/module/micronumpy/interp_support.py
--- a/pypy/module/micronumpy/interp_support.py
+++ b/pypy/module/micronumpy/interp_support.py
@@ -1,5 +1,5 @@
from pypy.interpreter.error import OperationError, operationerrfmt
-from pypy.interpreter.gateway import unwrap_spec, is_none, WrappedDefault
+from pypy.interpreter.gateway import unwrap_spec, WrappedDefault
from pypy.rpython.lltypesystem import lltype, rffi
from pypy.module.micronumpy import interp_dtype, loop
from pypy.objspace.std.strutil import strip_spaces
@@ -87,7 +87,7 @@
return _fromstring_text(space, s, count, sep, length, dtype)
def unwrap_axis_arg(space, shapelen, w_axis):
- if is_none(space, w_axis):
+ if space.is_none(w_axis):
axis = maxint
else:
axis = space.int_w(w_axis)
More information about the pypy-commit
mailing list