aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2011-08-02 11:25:39 +0200
committerArmin Rigo <arigo@tunes.org>2011-08-02 11:25:39 +0200
commit8e4e90b3817f4c35e18eb921913a7891ed139ac2 (patch)
treeb540badbd5c6c8fb9932b9bb9d914cb1386ee346
parentFix test. (diff)
parentuse just a name of the type (diff)
downloadpypy-8e4e90b3817f4c35e18eb921913a7891ed139ac2.tar.gz
pypy-8e4e90b3817f4c35e18eb921913a7891ed139ac2.tar.bz2
pypy-8e4e90b3817f4c35e18eb921913a7891ed139ac2.zip
merge heads
-rw-r--r--pypy/interpreter/gateway.py4
-rw-r--r--pypy/objspace/flow/operation.py8
-rw-r--r--pypy/rpython/lltypesystem/lltype.py2
3 files changed, 8 insertions, 6 deletions
diff --git a/pypy/interpreter/gateway.py b/pypy/interpreter/gateway.py
index a5d2ddd6b5..b01036e670 100644
--- a/pypy/interpreter/gateway.py
+++ b/pypy/interpreter/gateway.py
@@ -64,7 +64,7 @@ class UnwrapSpecRecipe(object):
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 @@ class UnwrapSpecRecipe(object):
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
index cf42bbf2b7..bc58019f90 100644
--- a/pypy/objspace/flow/operation.py
+++ b/pypy/objspace/flow/operation.py
@@ -359,10 +359,10 @@ def make_op(fs, name, symbol, arity, specialnames):
# 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
index c1c4133f3c..249a9ad905 100644
--- a/pypy/rpython/lltypesystem/lltype.py
+++ b/pypy/rpython/lltypesystem/lltype.py
@@ -1149,7 +1149,7 @@ class _abstract_ptr(object):
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):