Author: Richard Plangger <[email protected]>
Branch: py3.5-str-opt
Changeset: r87757:c18707100394
Date: 2016-10-13 16:08 +0200
http://bitbucket.org/pypy/pypy/changeset/c18707100394/
Log: move the test to unicode (bytes.format does not exist anymore)
diff --git a/lib-python/3/test/test_unicode.py
b/lib-python/3/test/test_unicode.py
--- a/lib-python/3/test/test_unicode.py
+++ b/lib-python/3/test/test_unicode.py
@@ -671,6 +671,10 @@
'\U000104A0', '\U0001F107']:
self.assertTrue(ch.isnumeric(), '{!a} is numeric.'.format(ch))
+ def test_format_c_overflow(self):
+ raises(OverflowError, b'{0:c}'.format, -1)
+ raises(OverflowError, b'{0:c}'.format, 2**64)
+
def test_isidentifier(self):
self.assertTrue("a".isidentifier())
self.assertTrue("Z".isidentifier())
diff --git a/pypy/objspace/std/test/test_bytesobject.py
b/pypy/objspace/std/test/test_bytesobject.py
--- a/pypy/objspace/std/test/test_bytesobject.py
+++ b/pypy/objspace/std/test/test_bytesobject.py
@@ -106,10 +106,6 @@
raises(TypeError, bytes.fromhex, True)
raises(ValueError, bytes.fromhex, "hello world")
- def test_format_c_overflow(self):
- raises(OverflowError, b'{0:c}'.format, -1)
- raises(OverflowError, b'{0:c}'.format, 256)
-
def test_format_wrongtype(self):
for int_format in '%d', '%o', '%x':
exc_info = raises(TypeError, int_format.__mod__, '123')
diff --git a/rpython/rlib/runicode.py b/rpython/rlib/runicode.py
--- a/rpython/rlib/runicode.py
+++ b/rpython/rlib/runicode.py
@@ -1358,7 +1358,6 @@
if size == 0:
return STR('')
-
pos = 0
while pos < size:
ch = s[pos]
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit