[pypy-commit] pypy py3k: hg merge
antocuni
noreply at buildbot.pypy.org
Fri Sep 14 11:19:24 CEST 2012
Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: py3k
Changeset: r57342:1234024e8a94
Date: 2012-09-14 11:19 +0200
http://bitbucket.org/pypy/pypy/changeset/1234024e8a94/
Log: hg merge
diff --git a/pypy/module/_ffi/app_struct.py b/pypy/module/_ffi/app_struct.py
--- a/pypy/module/_ffi/app_struct.py
+++ b/pypy/module/_ffi/app_struct.py
@@ -17,5 +17,5 @@
dic['_struct_'] = struct_descr
-class Structure(object):
- __metaclass__ = MetaStructure
+class Structure(metaclass=MetaStructure):
+ pass
diff --git a/pypy/module/_ffi/test/test_funcptr.py b/pypy/module/_ffi/test/test_funcptr.py
--- a/pypy/module/_ffi/test/test_funcptr.py
+++ b/pypy/module/_ffi/test/test_funcptr.py
@@ -579,7 +579,7 @@
pow = libm.getfunc('pow', [types.double, types.double], types.double)
try:
pow(2, 3)
- except ValueError, e:
+ except ValueError as e:
assert e.message.startswith('Procedure called with')
else:
assert 0, 'test must assert, wrong calling convention'
@@ -600,7 +600,7 @@
wrong_sleep = wrong_kernel.getfunc('Sleep', [types.uint], types.void)
try:
wrong_sleep(10)
- except ValueError, e:
+ except ValueError as e:
assert e.message.startswith('Procedure called with')
else:
assert 0, 'test must assert, wrong calling convention'
@@ -616,7 +616,7 @@
[types.double, types.double], types.double, FUNCFLAG_STDCALL)
try:
wrong_pow(2, 3) == 8
- except ValueError, e:
+ except ValueError as e:
assert e.message.startswith('Procedure called with')
else:
assert 0, 'test must assert, wrong calling convention'
diff --git a/pypy/module/_ffi/test/test_struct.py b/pypy/module/_ffi/test/test_struct.py
--- a/pypy/module/_ffi/test/test_struct.py
+++ b/pypy/module/_ffi/test/test_struct.py
@@ -172,15 +172,15 @@
struct.setfield('uint', 43)
assert struct.getfield('uint') == 43
struct.setfield('ulong', -1)
- assert struct.getfield('ulong') == sys.maxint*2 + 1
- struct.setfield('ulong', sys.maxint*2 + 2)
+ assert struct.getfield('ulong') == sys.maxsize*2 + 1
+ struct.setfield('ulong', sys.maxsize*2 + 2)
assert struct.getfield('ulong') == 0
struct.setfield('char', 'a')
assert struct.getfield('char') == 'a'
- struct.setfield('unichar', u'\u1234')
- assert struct.getfield('unichar') == u'\u1234'
+ struct.setfield('unichar', '\u1234')
+ assert struct.getfield('unichar') == '\u1234'
struct.setfield('ptr', -1)
- assert struct.getfield('ptr') == sys.maxint*2 + 1
+ assert struct.getfield('ptr') == sys.maxsize*2 + 1
def test_getfield_setfield_longlong(self):
import sys
diff --git a/pypy/module/_multibytecodec/c_codecs.py b/pypy/module/_multibytecodec/c_codecs.py
--- a/pypy/module/_multibytecodec/c_codecs.py
+++ b/pypy/module/_multibytecodec/c_codecs.py
@@ -279,10 +279,8 @@
replace = "?"
else:
assert errorcb
- ret, end = errorcb(errors, namecb, reason,
- unicodedata, start, end)
- codec = pypy_cjk_enc_getcodec(encodebuf)
- replace = encode(codec, ret, "strict", errorcb, namecb)
+ replace, end = errorcb(errors, namecb, reason,
+ unicodedata, start, end)
inbuf = rffi.get_nonmovingbuffer(replace)
try:
r = pypy_cjk_enc_replace_on_error(encodebuf, inbuf, len(replace), end)
More information about the pypy-commit
mailing list