Commits

Philip Jenvey committed ed95760

adapt to py3

Comments (0)

Files changed (4)

pypy/module/posix/test/test_posix2.py

             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

pypy/module/test_lib_pypy/test__pickle.py

+
+class AppTestPickle:
+
+    def test_stack_underflow(self):
+        import _pickle
+        raises(TypeError, _pickle.loads, "a string")

pypy/module/test_lib_pypy/test_cPickle.py

-from __future__ import absolute_import
-import py
-
-from lib_pypy import cPickle
-
-def test_stack_underflow():
-    py.test.raises(cPickle.UnpicklingError, cPickle.loads, "a string")

pypy/module/thread/test/test_fork.py

 
     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")
         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)
                 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.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.