Author: Brian Kearns <[email protected]>
Branch: py3k
Changeset: r60699:4f314755eb52
Date: 2013-01-29 18:01 -0500
http://bitbucket.org/pypy/pypy/changeset/4f314755eb52/
Log: merge default
diff --git a/lib-python/2.7/inspect.py b/lib-python/2.7/inspect.py
--- a/lib-python/2.7/inspect.py
+++ b/lib-python/2.7/inspect.py
@@ -960,7 +960,7 @@
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:
diff --git a/lib-python/2.7/site.py b/lib-python/2.7/site.py
--- a/lib-python/2.7/site.py
+++ b/lib-python/2.7/site.py
@@ -75,6 +75,7 @@
USER_SITE = None
USER_BASE = None
+
def makepath(*paths):
dir = os.path.join(*paths)
try:
diff --git a/lib-python/2.7/test/test_itertools.py
b/lib-python/2.7/test/test_itertools.py
--- a/lib-python/2.7/test/test_itertools.py
+++ b/lib-python/2.7/test/test_itertools.py
@@ -533,11 +533,11 @@
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'))
@@ -588,6 +588,7 @@
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'))
diff --git a/lib-python/2.7/test/test_support.py
b/lib-python/2.7/test/test_support.py
--- a/lib-python/2.7/test/test_support.py
+++ b/lib-python/2.7/test/test_support.py
@@ -1085,7 +1085,6 @@
else:
runner = BasicTestRunner()
-
result = runner.run(suite)
if not result.wasSuccessful():
if len(result.errors) == 1 and not result.failures:
diff --git a/lib-python/conftest.py b/lib-python/conftest.py
--- a/lib-python/conftest.py
+++ b/lib-python/conftest.py
@@ -94,17 +94,10 @@
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'),
@@ -114,7 +107,7 @@
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'),
@@ -167,10 +160,10 @@
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'),
@@ -202,7 +195,7 @@
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),
@@ -228,13 +221,13 @@
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),
@@ -285,13 +278,12 @@
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'),
@@ -301,7 +293,7 @@
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'),
@@ -320,8 +312,8 @@
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"),
@@ -332,8 +324,8 @@
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'),
@@ -346,7 +338,7 @@
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'),
@@ -383,7 +375,7 @@
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"),
@@ -394,7 +386,7 @@
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'),
@@ -441,11 +433,11 @@
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'),
@@ -463,7 +455,9 @@
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
diff --git a/pypy/module/_socket/interp_socket.py
b/pypy/module/_socket/interp_socket.py
--- a/pypy/module/_socket/interp_socket.py
+++ b/pypy/module/_socket/interp_socket.py
@@ -196,7 +196,8 @@
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)
@@ -456,7 +457,7 @@
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):
diff --git a/pypy/module/_socket/test/test_sock_app.py
b/pypy/module/_socket/test/test_sock_app.py
--- a/pypy/module/_socket/test/test_sock_app.py
+++ b/pypy/module/_socket/test/test_sock_app.py
@@ -346,13 +346,15 @@
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
@@ -360,7 +362,7 @@
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
diff --git a/pypy/module/cpyext/api.py b/pypy/module/cpyext/api.py
--- a/pypy/module/cpyext/api.py
+++ b/pypy/module/cpyext/api.py
@@ -920,8 +920,8 @@
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
diff --git a/rpython/jit/metainterp/optimizeopt/rewrite.py
b/rpython/jit/metainterp/optimizeopt/rewrite.py
--- a/rpython/jit/metainterp/optimizeopt/rewrite.py
+++ b/rpython/jit/metainterp/optimizeopt/rewrite.py
@@ -239,6 +239,8 @@
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.
diff --git a/rpython/jit/metainterp/optimizeopt/test/test_optimizeopt.py
b/rpython/jit/metainterp/optimizeopt/test/test_optimizeopt.py
--- a/rpython/jit/metainterp/optimizeopt/test/test_optimizeopt.py
+++ b/rpython/jit/metainterp/optimizeopt/test/test_optimizeopt.py
@@ -2623,7 +2623,7 @@
jump(p2)
"""
self.raises(InvalidLoop, self.optimize_loop,
- ops, ops)
+ ops, "crash!")
def test_invalid_loop_2(self):
ops = """
@@ -2635,7 +2635,7 @@
jump(p2)
"""
self.raises(InvalidLoop, self.optimize_loop,
- ops, ops)
+ ops, "crash!")
def test_invalid_loop_3(self):
ops = """
@@ -2648,8 +2648,17 @@
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 = """
diff --git a/rpython/translator/c/src/thread_nt.c
b/rpython/translator/c/src/thread_nt.c
--- a/rpython/translator/c/src/thread_nt.c
+++ b/rpython/translator/c/src/thread_nt.c
@@ -13,6 +13,7 @@
/*
* Thread support.
*/
+/* In rpython, this file is pulled in by thread.c */
typedef struct RPyOpaque_ThreadLock NRMUTEX, *PNRMUTEX;
diff --git a/rpython/translator/c/src/thread_nt.h
b/rpython/translator/c/src/thread_nt.h
--- a/rpython/translator/c/src/thread_nt.h
+++ b/rpython/translator/c/src/thread_nt.h
@@ -9,6 +9,7 @@
} NRMUTEX, *PNRMUTEX;
/* prototypes */
+long RPyThreadGetIdent(void);
long RPyThreadStart(void (*func)(void));
int RPyThreadLockInit(struct RPyOpaque_ThreadLock *lock);
void RPyOpaqueDealloc_ThreadLock(struct RPyOpaque_ThreadLock *lock);
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit