Author: Armin Rigo <[email protected]>
Branch: py3.5
Changeset: r88757:fbe001ae02e9
Date: 2016-11-30 11:14 +0100
http://bitbucket.org/pypy/pypy/changeset/fbe001ae02e9/
Log: hg merge default
diff --git a/pypy/objspace/descroperation.py b/pypy/objspace/descroperation.py
--- a/pypy/objspace/descroperation.py
+++ b/pypy/objspace/descroperation.py
@@ -705,7 +705,7 @@
return w_result
raise oefmt(space.w_TypeError,
- "%(specialname)s returned non-%(targetname)s (type "
+ "%(specialname)s returned non-string (type "
"'%%T')", w_result)
assert not hasattr(DescrOperation, %(targetname)r)
DescrOperation.%(targetname)s = %(targetname)s
diff --git a/pypy/objspace/test/test_descroperation.py
b/pypy/objspace/test/test_descroperation.py
--- a/pypy/objspace/test/test_descroperation.py
+++ b/pypy/objspace/test/test_descroperation.py
@@ -280,7 +280,8 @@
assert operate(A()) == "hello" * n
assert type(operate(A())) is str
answer = 42
- raises(TypeError, operate, A())
+ excinfo = raises(TypeError, operate, A())
+ assert "returned non-string (type 'int')" in str(excinfo.value)
def test_string_results_unicode(self):
class A(object):
diff --git a/rpython/memory/gc/incminimark.py b/rpython/memory/gc/incminimark.py
--- a/rpython/memory/gc/incminimark.py
+++ b/rpython/memory/gc/incminimark.py
@@ -1164,6 +1164,11 @@
obj = self.get_forwarding_address(obj)
return self.get_type_id(obj)
+ def get_possibly_forwarded_tid(self, obj):
+ if self.is_in_nursery(obj) and self.is_forwarded(obj):
+ obj = self.get_forwarding_address(obj)
+ return self.header(obj).tid
+
def get_total_memory_used(self):
"""Return the total memory used, not counting any object in the
nursery: only objects in the ArenaCollection or raw-malloced.
@@ -2678,7 +2683,7 @@
while self.probably_young_objects_with_finalizers.non_empty():
obj = self.probably_young_objects_with_finalizers.popleft()
fq_nr = self.probably_young_objects_with_finalizers.popleft()
- if self.header(obj).tid & GCFLAG_IGNORE_FINALIZER:
+ if self.get_possibly_forwarded_tid(obj) & GCFLAG_IGNORE_FINALIZER:
continue
self.singleaddr.address[0] = obj
self._trace_drag_out1(self.singleaddr)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit