Author: Armin Rigo <[email protected]>
Branch:
Changeset: r46187:a161365b51ee
Date: 2011-08-02 11:25 +0200
http://bitbucket.org/pypy/pypy/changeset/a161365b51ee/
Log: merge heads
diff --git a/pypy/interpreter/gateway.py b/pypy/interpreter/gateway.py
--- a/pypy/interpreter/gateway.py
+++ b/pypy/interpreter/gateway.py
@@ -64,7 +64,7 @@
self.visit_self(el[1], *args)
else:
self.visit_function(el, *args)
- else:
+ elif isinstance(el, type):
for typ in self.bases_order:
if issubclass(el, typ):
visit = getattr(self, "visit__%s" % (typ.__name__,))
@@ -73,6 +73,8 @@
else:
raise Exception("%s: no match for unwrap_spec element %s" % (
self.__class__.__name__, el))
+ else:
+ raise Exception("unable to dispatch, %s, perhaps your parameter
should have started with w_?" % el)
def apply_over(self, unwrap_spec, *extra):
dispatch = self.dispatch
diff --git a/pypy/objspace/flow/operation.py b/pypy/objspace/flow/operation.py
--- a/pypy/objspace/flow/operation.py
+++ b/pypy/objspace/flow/operation.py
@@ -359,10 +359,10 @@
# All arguments are constants: call the operator now
try:
result = op(*args)
- except:
- etype, evalue, etb = sys.exc_info()
- msg = "generated by a constant operation: %s%r" % (
- name, tuple(args))
+ except Exception, e:
+ etype = e.__class__
+ msg = "generated by a constant operation: %s" % (
+ name)
raise OperationThatShouldNotBePropagatedError(
self.wrap(etype), self.wrap(msg))
else:
diff --git a/pypy/rpython/lltypesystem/lltype.py
b/pypy/rpython/lltypesystem/lltype.py
--- a/pypy/rpython/lltypesystem/lltype.py
+++ b/pypy/rpython/lltypesystem/lltype.py
@@ -1149,7 +1149,7 @@
try:
return self._lookup_adtmeth(field_name)
except AttributeError:
- raise AttributeError("%r instance has no field %r" % (self._T,
+ raise AttributeError("%r instance has no field %r" %
(self._T._name,
field_name))
def __setattr__(self, field_name, val):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit