Author: Philip Jenvey <pjen...@underboss.org> Branch: py3k Changeset: r64209:94d29c0adce5 Date: 2013-05-15 16:29 -0700 http://bitbucket.org/pypy/pypy/changeset/94d29c0adce5/
Log: merge default diff --git a/lib-python/2.7/test/test_codecs.py b/lib-python/2.7/test/test_codecs.py --- a/lib-python/2.7/test/test_codecs.py +++ b/lib-python/2.7/test/test_codecs.py @@ -2,7 +2,11 @@ import unittest import codecs import locale -import sys, StringIO, _testcapi +import sys, StringIO +try: + import _testcapi +except ImportError: + _testcapi = None class Queue(object): """ @@ -1387,8 +1391,7 @@ decodedresult += reader.read() self.assertEqual(decodedresult, s, "%r != %r (encoding=%r)" % (decodedresult, s, encoding)) - if (encoding not in broken_incremental_coders and - hasattr(_testcapi, 'codec_incrementalencoder')): + if encoding not in broken_incremental_coders and _testcapi: # check incremental decoder/encoder (fetched via the Python # and C API) and iterencode()/iterdecode() try: diff --git a/lib-python/2.7/test/test_descr.py b/lib-python/2.7/test/test_descr.py --- a/lib-python/2.7/test/test_descr.py +++ b/lib-python/2.7/test/test_descr.py @@ -2080,9 +2080,8 @@ except ImportError: pass else: - if hasattr(_testcapi, 'test_with_docstring'): - class X(object): - p = property(_testcapi.test_with_docstring) + class X(object): + p = property(_testcapi.test_with_docstring) def test_properties_plus(self): class C(object): diff --git a/lib-python/conftest.py b/lib-python/conftest.py --- a/lib-python/conftest.py +++ b/lib-python/conftest.py @@ -123,7 +123,6 @@ RegrTest('test_bz2.py', usemodules='bz2'), RegrTest('test_calendar.py'), RegrTest('test_call.py', core=True), - RegrTest('test_capi.py'), RegrTest('test_cfgparser.py'), RegrTest('test_cgi.py'), RegrTest('test_charmapcodec.py', core=True), @@ -163,7 +162,7 @@ RegrTest('test_cprofile.py'), RegrTest('test_crypt.py', usemodules='crypt'), RegrTest('test_csv.py', usemodules='_csv'), - RegrTest('test_ctypes.py', usemodules="_rawffi thread"), + RegrTest('test_ctypes.py', usemodules="_rawffi thread cpyext"), RegrTest('test_curses.py'), RegrTest('test_datetime.py', usemodules='binascii struct'), RegrTest('test_dbm.py'), diff --git a/lib_pypy/_testcapi.py b/lib_pypy/_testcapi.py --- a/lib_pypy/_testcapi.py +++ b/lib_pypy/_testcapi.py @@ -57,6 +57,6 @@ try: import cpyext except ImportError: - pass + raise ImportError("No module named '_testcapi'") else: compile_shared() diff --git a/rpython/memory/gctransform/asmgcroot.py b/rpython/memory/gctransform/asmgcroot.py --- a/rpython/memory/gctransform/asmgcroot.py +++ b/rpython/memory/gctransform/asmgcroot.py @@ -331,6 +331,11 @@ [annmodel.SomeInteger(), annmodel.SomeAddress()], annmodel.s_None) + # + # check that the order of the need_*() is correct for us: if we + # need both threads and stacklets, need_thread_support() must be + # called first, to initialize self.belongs_to_current_thread. + assert not hasattr(self, 'gc_detach_callback_pieces_ptr') def walk_stack_roots(self, collect_stack_root): gcdata = self.gcdata diff --git a/rpython/memory/gctransform/framework.py b/rpython/memory/gctransform/framework.py --- a/rpython/memory/gctransform/framework.py +++ b/rpython/memory/gctransform/framework.py @@ -236,9 +236,10 @@ # thread support if translator.config.translation.continuation: root_walker.stacklet_support = True - root_walker.need_stacklet_support(self, getfn) if translator.config.translation.thread: root_walker.need_thread_support(self, getfn) + if root_walker.stacklet_support: + root_walker.need_stacklet_support(self, getfn) self.layoutbuilder.encode_type_shapes_now() diff --git a/rpython/rtyper/rpbc.py b/rpython/rtyper/rpbc.py --- a/rpython/rtyper/rpbc.py +++ b/rpython/rtyper/rpbc.py @@ -529,7 +529,7 @@ im_selves = [] for desc in s_pbc.descriptions: - assert desc.funcdesc is self.funcdesc + assert desc.funcdesc is self.funcdesc, "You can't mix a set of methods on a frozen PBC in RPython that are different underlaying functions" im_selves.append(desc.frozendesc) self.s_im_self = annmodel.SomePBC(im_selves) _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit