[pypy-commit] pypy py3.5: random attempts at getting more info
arigo
pypy.commits at gmail.com
Tue Nov 29 11:53:56 EST 2016
Author: Armin Rigo <arigo at tunes.org>
Branch: py3.5
Changeset: r88753:e29cc6279dfb
Date: 2016-11-29 17:53 +0100
http://bitbucket.org/pypy/pypy/changeset/e29cc6279dfb/
Log: random attempts at getting more info
diff --git a/pypy/module/pypyjit/test_pypy_c/test_string.py b/pypy/module/pypyjit/test_pypy_c/test_string.py
--- a/pypy/module/pypyjit/test_pypy_c/test_string.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_string.py
@@ -7,12 +7,12 @@
class TestString(BaseTestPyPyC):
def test_lookup_default_encoding(self):
def main(n):
- import string
i = 0
- letters = string.letters
- uletters = unicode(string.letters)
+ letters = b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
+ uletters = u'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
while i < n:
- i += letters[i % len(letters)] == uletters[i % len(letters)]
+ i += (letters[i % len(letters)].decode() ==
+ uletters[i % len(letters)])
return i
log = self.run(main, [300], import_site=True)
@@ -45,7 +45,7 @@
def test_long(self):
def main(n):
- import string
+ digits = '0123456789'
i = 1
while i < n:
i += int(long(string.digits[i % len(string.digits)], 16))
More information about the pypy-commit
mailing list