Author: Philip Jenvey <[email protected]>
Branch: py3k
Changeset: r59415:6e758a21cc92
Date: 2012-12-13 15:05 -0800
http://bitbucket.org/pypy/pypy/changeset/6e758a21cc92/

Log:    kill long's suffix support

diff --git a/pypy/objspace/std/strutil.py b/pypy/objspace/std/strutil.py
--- a/pypy/objspace/std/strutil.py
+++ b/pypy/objspace/std/strutil.py
@@ -131,13 +131,9 @@
 
 @enforceargs(unicode, None, None)
 def string_to_bigint(s, base=10, parser=None):
-    """As string_to_int(), but ignores an optional 'l' or 'L' suffix
-    and returns an rbigint."""
+    """As string_to_int() but returns an rbigint."""
     if parser is None:
         s = literal = strip_spaces(s)
-        if (s.endswith(u'l') or s.endswith(u'L')) and base < 22:
-            # in base 22 and above, 'L' is a valid digit!  try: long('L',22)
-            s = s[:-1]
         p = NumberStringParser(s, literal, base, u'int')
     else:
         p = parser
diff --git a/pypy/objspace/std/test/test_longobject.py 
b/pypy/objspace/std/test/test_longobject.py
--- a/pypy/objspace/std/test/test_longobject.py
+++ b/pypy/objspace/std/test/test_longobject.py
@@ -325,6 +325,8 @@
         assert type(b) is int
 
     def test_long_from_unicode(self):
+        raises(ValueError, int, '123L')
+        assert int('L', 22) == 21
         s = '\U0001D7CF\U0001D7CE' # &#120783;&#120782;
         assert int(s) == 10
 
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to