[pypy-commit] pypy newinitwarn: try the warnings as exceptions to see how potentially annoying they'd be on
pjenvey
pypy.commits at gmail.com
Sat May 21 19:03:07 EDT 2016
Author: Philip Jenvey <pjenvey at underboss.org>
Branch: newinitwarn
Changeset: r84565:57573ddc5c33
Date: 2016-05-21 16:00 -0700
http://bitbucket.org/pypy/pypy/changeset/57573ddc5c33/
Log: try the warnings as exceptions to see how potentially annoying
they'd be on pypy
diff --git a/pypy/objspace/std/objectobject.py b/pypy/objspace/std/objectobject.py
--- a/pypy/objspace/std/objectobject.py
+++ b/pypy/objspace/std/objectobject.py
@@ -98,8 +98,10 @@
w_parent_init, _ = space.lookup_in_type_where(w_type, '__init__')
if (w_parent_new is not space.w_object and
w_parent_init is not space.w_object):
- space.warn(space.wrap("object() takes no parameters"),
- space.w_DeprecationWarning, 1)
+ #space.warn(space.wrap("object() takes no parameters"),
+ # space.w_DeprecationWarning, 1)
+ raise oefmt(space.w_TypeError,
+ "!!object() takes no parameters")
elif (w_parent_new is not space.w_object or
w_parent_init is space.w_object):
raise oefmt(space.w_TypeError,
@@ -121,8 +123,10 @@
w_parent_new, _ = space.lookup_in_type_where(w_type, '__new__')
if (w_parent_init is not space.w_object and
w_parent_new is not space.w_object):
- space.warn(space.wrap("object.__init__() takes no parameters"),
- space.w_DeprecationWarning, 1)
+ #space.warn(space.wrap("object.__init__() takes no parameters"),
+ # space.w_DeprecationWarning, 1)
+ raise oefmt(space.w_TypeError,
+ "!!!!object.__init__() takes no parameters")
elif (w_parent_init is not space.w_object or
w_parent_new is space.w_object):
raise oefmt(space.w_TypeError,
More information about the pypy-commit
mailing list