Author: Philip Jenvey <pjen...@underboss.org> Branch: py3k Changeset: r61107:ed9576076627 Date: 2013-02-11 15:50 -0800 http://bitbucket.org/pypy/pypy/changeset/ed9576076627/
Log: adapt to py3 diff --git a/pypy/module/posix/test/test_posix2.py b/pypy/module/posix/test/test_posix2.py --- a/pypy/module/posix/test/test_posix2.py +++ b/pypy/module/posix/test/test_posix2.py @@ -489,16 +489,6 @@ res = fp.read() assert res == '1\n' - def test_popen_child_fds(self): - import os - with open(os.path.join(self.pdir, 'file1'), 'r') as fd: - with self.posix.popen('%s -c "import os; print os.read(%d, 10)" 2>&1' % (self.python, fd.fileno())) as stream: - res = stream.read() - if os.name == 'nt': - assert '\nOSError: [Errno 9]' in res - else: - assert res == 'test1\n' - if hasattr(__import__(os.name), '_getfullpathname'): def test__getfullpathname(self): # nt specific diff --git a/pypy/module/test_lib_pypy/test_cPickle.py b/pypy/module/test_lib_pypy/test__pickle.py rename from pypy/module/test_lib_pypy/test_cPickle.py rename to pypy/module/test_lib_pypy/test__pickle.py --- a/pypy/module/test_lib_pypy/test_cPickle.py +++ b/pypy/module/test_lib_pypy/test__pickle.py @@ -1,7 +1,6 @@ -from __future__ import absolute_import -import py -from lib_pypy import cPickle +class AppTestPickle: -def test_stack_underflow(): - py.test.raises(cPickle.UnpicklingError, cPickle.loads, "a string") + def test_stack_underflow(self): + import _pickle + raises(TypeError, _pickle.loads, "a string") diff --git a/pypy/module/thread/test/test_fork.py b/pypy/module/thread/test/test_fork.py --- a/pypy/module/thread/test/test_fork.py +++ b/pypy/module/thread/test/test_fork.py @@ -60,7 +60,7 @@ def test_forked_is_main_thread(self): "Checks that a forked interpreter is the main thread" - import os, thread, signal + import os, _thread, signal if not hasattr(os, 'fork'): skip("No fork on this platform") @@ -68,7 +68,7 @@ def threadfunction(): pid = os.fork() if pid == 0: - print 'in child' + print('in child') # signal() only works from the 'main' thread signal.signal(signal.SIGUSR1, signal.SIG_IGN) os._exit(42) @@ -78,7 +78,7 @@ feedback.append(exitcode) feedback = [] - thread.start_new_thread(threadfunction, ()) + _thread.start_new_thread(threadfunction, ()) self.waitfor(lambda: feedback) # if 0, an (unraisable) exception was raised from the forked thread. # if 9, process was killed by timer. _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit