[pypy-svn] r10374 - in pypy/branch/pypy-normalize-exception: interpreter tool
arigo at codespeak.net
arigo at codespeak.net
Wed Apr 6 20:44:11 CEST 2005
Author: arigo
Date: Wed Apr 6 20:44:11 2005
New Revision: 10374
Modified:
pypy/branch/pypy-normalize-exception/interpreter/error.py
pypy/branch/pypy-normalize-exception/tool/pytestsupport.py
Log:
No, it wasn't a good idea to check for __module__ != '__builtin__' after all.
Modified: pypy/branch/pypy-normalize-exception/interpreter/error.py
==============================================================================
--- pypy/branch/pypy-normalize-exception/interpreter/error.py (original)
+++ pypy/branch/pypy-normalize-exception/interpreter/error.py Wed Apr 6 20:44:11 2005
@@ -170,13 +170,14 @@
if space.full_exceptions:
# for the sake of language consistency we should not allow
# things like 'raise 1', but it is probably fine (i.e.
- # not ambiguous) to allow them in the explicit form 'raise int, 1'
+ # not ambiguous) to allow them in the explicit form
+ # 'raise int, 1'
try:
- w_module = space.getattr(w_type, space.wrap('__module__'))
+ space.getattr(w_value, space.wrap('__dict__'))
except OperationError:
- pass
- else:
- if space.eq_w(w_module, space.wrap('__builtin__')):
+ try:
+ space.getattr(w_value, space.wrap('__slots__'))
+ except OperationError:
raise OperationError(space.w_TypeError,
space.wrap("raising built-in objects can "
"be ambiguous, "
Modified: pypy/branch/pypy-normalize-exception/tool/pytestsupport.py
==============================================================================
--- pypy/branch/pypy-normalize-exception/tool/pytestsupport.py (original)
+++ pypy/branch/pypy-normalize-exception/tool/pytestsupport.py Wed Apr 6 20:44:11 2005
@@ -118,7 +118,6 @@
gateway.Arguments]))
w_dict = space.newdict([])
space.setitem(w_dict, space.wrap('__init__'), w_init)
- space.setitem(w_dict, space.wrap('__module__'), space.wrap('exceptions'))
return space.call_function(w_metaclass,
space.wrap('AssertionError'),
space.newtuple([w_BuiltinAssertionError]),
More information about the Pypy-commit
mailing list