Commits

Brian Kearns committed 4f31475 Merge

merge default

Comments (0)

Files changed (12)

lib-python/2.7/inspect.py

                 raise TypeError('%s() takes exactly 0 arguments '
                                 '(%d given)' % (f_name, num_total))
         else:
-            raise TypeError('%s() takes no argument (%d given)' %
+            raise TypeError('%s() takes no arguments (%d given)' %
                             (f_name, num_total))
     for arg in args:
         if isinstance(arg, str) and arg in named:

lib-python/2.7/site.py

 USER_SITE = None
 USER_BASE = None
 
+
 def makepath(*paths):
     dir = os.path.join(*paths)
     try:

lib-python/2.7/test/test_itertools.py

         self.assertEqual(list(izip()), zip())
         self.assertRaises(TypeError, izip, 3)
         self.assertRaises(TypeError, izip, range(3), 3)
-
         self.assertEqual([tuple(list(pair)) for pair in izip('abc', 'def')],
                          zip('abc', 'def'))
         self.assertEqual([pair for pair in izip('abc', 'def')],
                          zip('abc', 'def'))
+
     @test_support.impl_detail("tuple reuse is specific to CPython")
     def test_izip_tuple_reuse(self):
         ids = map(id, izip('abc', 'def'))
                          zip('abc', 'def'))
         self.assertEqual([pair for pair in izip_longest('abc', 'def')],
                          zip('abc', 'def'))
+
     @test_support.impl_detail("tuple reuse is specific to CPython")
     def test_izip_longest_tuple_reuse(self):
         ids = map(id, izip_longest('abc', 'def'))

lib-python/2.7/test/test_support.py

     else:
         runner = BasicTestRunner()
 
-
     result = runner.run(suite)
     if not result.wasSuccessful():
         if len(result.errors) == 1 and not result.failures:

lib-python/conftest.py

                 m.test_main()
         ''' % locals())
 
-if sys.platform == 'win32':
-    skip_win32 = "Not supported on Windows"
-    only_win32 = False
-else:
-    skip_win32 = False
-    only_win32 = "Only on Windows"
-
 testmap = [
     RegrTest('test___all__.py', core=True),
     RegrTest('test___future__.py', core=True),
-    RegrTest('test__locale.py', usemodules='_locale', skip=skip_win32),
+    RegrTest('test__locale.py', usemodules='_locale'),
     RegrTest('test_abc.py'),
     RegrTest('test_abstract_numbers.py'),
     RegrTest('test_aifc.py'),
     RegrTest('test_asynchat.py', usemodules='select fcntl'),
     RegrTest('test_asyncore.py', usemodules='select fcntl'),
     RegrTest('test_atexit.py', core=True),
-    RegrTest('test_audioop.py', skip=True),
+    RegrTest('test_audioop.py', skip="unsupported extension module"),
     RegrTest('test_augassign.py', core=True),
     RegrTest('test_base64.py', usemodules='struct'),
     RegrTest('test_bigaddrspace.py'),
     RegrTest('test_copy.py', core=True),
     RegrTest('test_copyreg.py', core=True),
     RegrTest('test_cprofile.py'),
-    RegrTest('test_crypt.py', usemodules='crypt', skip=skip_win32),
+    RegrTest('test_crypt.py', usemodules='crypt'),
     RegrTest('test_csv.py', usemodules='_csv'),
     RegrTest('test_ctypes.py', usemodules="_rawffi thread"),
-    RegrTest('test_curses.py', skip="unsupported extension module"),
+    RegrTest('test_curses.py'),
     RegrTest('test_datetime.py'),
     RegrTest('test_dbm.py'),
     RegrTest('test_dbm_dumb.py'),
     RegrTest('test_exception_variations.py'),
     RegrTest('test_exceptions.py', core=True),
     RegrTest('test_extcall.py', core=True),
-    RegrTest('test_fcntl.py', usemodules='fcntl', skip=skip_win32),
+    RegrTest('test_fcntl.py', usemodules='fcntl'),
     RegrTest('test_file.py', usemodules="posix", core=True),
     RegrTest('test_filecmp.py', core=True),
     RegrTest('test_fileinput.py', core=True),
     RegrTest('test_generators.py', core=True, usemodules='thread _weakref'),
     RegrTest('test_genericpath.py'),
     RegrTest('test_genexps.py', core=True, usemodules='_weakref'),
-    RegrTest('test_getargs2.py', skip="unsupported extension module"),
+    RegrTest('test_getargs2.py', usemodules='binascii', skip=True),
     RegrTest('test_getopt.py', core=True),
     RegrTest('test_gettext.py'),
     RegrTest('test_glob.py', core=True),
     RegrTest('test_global.py', core=True),
     RegrTest('test_grammar.py', core=True),
-    RegrTest('test_grp.py', skip=skip_win32),
+    RegrTest('test_grp.py'),
     RegrTest('test_gzip.py', usemodules='zlib'),
     RegrTest('test_hash.py', core=True),
     RegrTest('test_hashlib.py', core=True),
     RegrTest('test_mmap.py', usemodules="mmap"),
     RegrTest('test_module.py', core=True),
     RegrTest('test_modulefinder.py'),
-    RegrTest('test_msilib.py', skip=only_win32),
+    RegrTest('test_msilib.py'),
     RegrTest('test_multibytecodec.py', usemodules='_multibytecodec'),
-    RegrTest('test_multibytecodec_support.py', skip="not a test"),
-    RegrTest('test_multiprocessing.py', skip="FIXME leaves subprocesses"),
+    RegrTest('test_multiprocessing.py', skip=True),
     RegrTest('test_mutants.py', core="possibly"),
     RegrTest('test_netrc.py'),
-    RegrTest('test_nis.py', skip="unsupported extension module"),
+    RegrTest('test_nis.py'),
     RegrTest('test_nntplib.py'),
     RegrTest('test_normalization.py'),
     RegrTest('test_ntpath.py'),
     RegrTest('test_operator.py', core=True),
     RegrTest('test_optparse.py'),
     RegrTest('test_os.py', core=True),
-    RegrTest('test_ossaudiodev.py', skip="unsupported extension module"),
+    RegrTest('test_ossaudiodev.py'),
     RegrTest('test_osx_env.py'),
     RegrTest('test_parser.py', skip="slowly deprecating compiler"),
     RegrTest('test_pdb.py'),
     RegrTest('test_pkgimport.py', core=True),
     RegrTest('test_pkgutil.py'),
     RegrTest('test_platform.py'),
-    RegrTest('test_plistlib.py', skip="unsupported module"),
-    RegrTest('test_poll.py', skip=skip_win32),
+    RegrTest('test_plistlib.py'),
+    RegrTest('test_poll.py'),
     RegrTest('test_popen.py'),
     RegrTest('test_poplib.py'),
     RegrTest('test_posix.py', usemodules="_rawffi"),
     RegrTest('test_profile.py'),
     RegrTest('test_property.py', core=True),
     RegrTest('test_pstats.py'),
-    RegrTest('test_pty.py', skip="unsupported extension module"),
-    RegrTest('test_pwd.py', usemodules="pwd", skip=skip_win32),
+    RegrTest('test_pty.py', usemodules='fcntl termios select'),
+    RegrTest('test_pwd.py', usemodules="pwd"),
     RegrTest('test_py_compile.py'),
     RegrTest('test_pyclbr.py'),
     RegrTest('test_pydoc.py'),
     RegrTest('test_re.py', core=True),
     RegrTest('test_readline.py'),
     RegrTest('test_reprlib.py', core=True),
-    RegrTest('test_resource.py', skip=skip_win32),
+    RegrTest('test_resource.py'),
     RegrTest('test_richcmp.py', core=True),
     RegrTest('test_rlcompleter.py'),
     RegrTest('test_robotparser.py'),
     RegrTest('test_structmembers.py', skip="CPython specific"),
     RegrTest('test_structseq.py'),
     RegrTest('test_subprocess.py', usemodules='signal'),
-    RegrTest('test_sunau.py', skip=True),
+    RegrTest('test_sunau.py', skip="unsupported extension module"),
     RegrTest('test_sundry.py'),
     RegrTest('test_super.py', core=True),
     RegrTest('test_symtable.py', skip="implementation detail"),
     RegrTest('test_sysconfig.py'),
     RegrTest('test_syslog.py'),
     RegrTest('test_tarfile.py'),
-    RegrTest('test_tcl.py', skip="unsupported extension module"),
+    RegrTest('test_tcl.py'),
     RegrTest('test_telnetlib.py'),
     RegrTest('test_tempfile.py'),
     RegrTest('test_textwrap.py'),
     RegrTest('test_wait3.py', usemodules="thread"),
     RegrTest('test_wait4.py', usemodules="thread"),
     RegrTest('test_warnings.py', core=True),
-    RegrTest('test_wave.py', skip="unsupported extension module"),
+    RegrTest('test_wave.py'),
     RegrTest('test_weakref.py', core=True, usemodules='_weakref'),
     RegrTest('test_weakset.py'),
-    RegrTest('test_winreg.py', skip=only_win32),
-    RegrTest('test_winsound.py', skip="unsupported extension module"),
+    RegrTest('test_winreg.py'),
+    RegrTest('test_winsound.py'),
     RegrTest('test_with.py'),
     RegrTest('test_wsgiref.py'),
     RegrTest('test_xdrlib.py'),
 def check_testmap_complete():
     listed_names = dict.fromkeys([regrtest.basename for regrtest in testmap])
     assert len(listed_names) == len(testmap)
-    listed_names['test_support.py'] = True     # ignore this
+    # names to ignore
+    listed_names['test_support.py'] = True
+    listed_names['test_multibytecodec_support.py'] = True
     missing = []
     for path in testdir.listdir(fil='test_*.py'):
         name = path.basename

pypy/module/_socket/interp_socket.py

         try:
             self.close()
         except SocketError, e:
-            raise converted_error(space, e)
+            # cpython doesn't return any errors on close
+            pass
 
     def connect_w(self, space, w_addr):
         """connect(address)
                 w_addr = space.w_None
             return space.newtuple([space.wrap(readlgt), w_addr])
         except SocketError, e:
-            raise converted_error(space, e)        
+            raise converted_error(space, e)
 
     @unwrap_spec(cmd=int)
     def ioctl_w(self, space, cmd, w_option):

pypy/module/_socket/test/test_sock_app.py

         assert isinstance(s.fileno(), int)
 
     def test_socket_close(self):
-        import _socket
+        import _socket, os
         s = _socket.socket(_socket.AF_INET, _socket.SOCK_STREAM, 0)
         fileno = s.fileno()
         assert s.fileno() >= 0
         s.close()
         assert s.fileno() < 0
         s.close()
+        if os.name != 'nt':
+            raises(OSError, os.close, fileno)
 
     def test_socket_close_error(self):
         import _socket, os
             skip("Windows sockets are not files")
         s = _socket.socket(_socket.AF_INET, _socket.SOCK_STREAM, 0)
         os.close(s.fileno())
-        raises(_socket.error, s.close)
+        s.close()
 
     def test_socket_connect(self):
         import _socket, os

pypy/module/cpyext/api.py

             kwds["link_extra"] = ["msvcrt.lib"]
         elif sys.platform.startswith('linux'):
             compile_extra.append("-Werror=implicit-function-declaration")
+            compile_extra.append('-g')
         export_symbols_eci.append('pypyAPI')
-        compile_extra.append('-g')
     else:
         kwds["includes"] = ['Python.h'] # this is our Python.h
 

rpython/jit/metainterp/optimizeopt/rewrite.py

 
     def optimize_GUARD_VALUE(self, op):
         value = self.getvalue(op.getarg(0))
+        if value.is_virtual():
+            raise InvalidLoop('A promote of a virtual (a recently allocated object) never makes sense!')
         if value.last_guard:
             # there already has been a guard_nonnull or guard_class or
             # guard_nonnull_class on this value, which is rather silly.

rpython/jit/metainterp/optimizeopt/test/test_optimizeopt.py

         jump(p2)
         """
         self.raises(InvalidLoop, self.optimize_loop,
-                       ops, ops)
+                       ops, "crash!")
 
     def test_invalid_loop_2(self):
         ops = """
         jump(p2)
         """
         self.raises(InvalidLoop, self.optimize_loop,
-                       ops, ops)
+                       ops, "crash!")
 
     def test_invalid_loop_3(self):
         ops = """
         setfield_gc(p3, p4, descr=nextdescr)
         jump(p3)
         """
-        self.raises(InvalidLoop, self.optimize_loop, ops, ops)
-
+        self.raises(InvalidLoop, self.optimize_loop, ops, "crash!")
+
+    def test_invalid_loop_guard_value_of_virtual(self):
+        ops = """
+        [p1]
+        p2 = new_with_vtable(ConstClass(node_vtable))
+        guard_value(p2, ConstPtr(myptr)) []
+        jump(p2)
+        """
+        self.raises(InvalidLoop, self.optimize_loop,
+                       ops, "crash!")
 
     def test_merge_guard_class_guard_value(self):
         ops = """

rpython/translator/c/src/thread_nt.c

 /*
  * Thread support.
  */
+/* In rpython, this file is pulled in by thread.c */
 
 typedef struct RPyOpaque_ThreadLock NRMUTEX, *PNRMUTEX;
 

rpython/translator/c/src/thread_nt.h

 } NRMUTEX, *PNRMUTEX;
 
 /* prototypes */
+long RPyThreadGetIdent(void);
 long RPyThreadStart(void (*func)(void));
 int RPyThreadLockInit(struct RPyOpaque_ThreadLock *lock);
 void RPyOpaqueDealloc_ThreadLock(struct RPyOpaque_ThreadLock *lock);