Author: mattip <[email protected]>
Branch: numpy-1.10
Changeset: r80716:79c16090f3f8
Date: 2015-11-16 20:09 +0200
http://bitbucket.org/pypy/pypy/changeset/79c16090f3f8/
Log: add numpy-specific warning to space
diff --git a/pypy/module/micronumpy/__init__.py
b/pypy/module/micronumpy/__init__.py
--- a/pypy/module/micronumpy/__init__.py
+++ b/pypy/module/micronumpy/__init__.py
@@ -43,6 +43,11 @@
from pypy.module.micronumpy.concrete import _setup
_setup()
+ def setup_after_space_initialization(self):
+ from pypy.module.micronumpy.support import W_VisibleDeprecationWarning
+ for name, w_type in {'VisibleDeprecationWarning':
W_VisibleDeprecationWarning}.items():
+ setattr(self.space, 'w_' + name, self.space.gettypefor(w_type))
+
class UMathModule(MixedModule):
appleveldefs = {}
interpleveldefs = {
diff --git a/pypy/module/micronumpy/ndarray.py
b/pypy/module/micronumpy/ndarray.py
--- a/pypy/module/micronumpy/ndarray.py
+++ b/pypy/module/micronumpy/ndarray.py
@@ -121,8 +121,8 @@
" dimension 0; dimension is %d but corresponding"
" boolean dimension is %d" % (self.get_shape()[0],
arr.get_shape()[0]))
- warning = space.gettypefor(support.W_VisibleDeprecationWarning)
- space.warn(space.wrap(msg), warning)
+ #warning =
space.gettypefor(support.W_VisibleDeprecationWarning)
+ space.warn(space.wrap(msg), space.w_VisibleDeprecationWarning)
res_shape = [size] + self.get_shape()[1:]
else:
res_shape = [size]
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit