From: Martijn Pieters Date: Thu, 25 Oct 2012 16:27:21 +0000 (+0200) Subject: Better not call it `chr`, rename to `byteschr`. X-Git-Tag: upstream/2.2.1~431^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=be01a35ef12c7e71c0e71c4e37d1f1a392a66fd8;p=platform%2Fupstream%2Fpython-requests.git Better not call it `chr`, rename to `byteschr`. --- diff --git a/tests/test_utils.py b/tests/test_utils.py index 1122fb3..c0560ec 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -14,7 +14,9 @@ from requests.compat import is_py3, bytes if is_py3: unichr = chr - chr = lambda c: bytes([c]) + byteschr = lambda c: bytes([c]) +else: + byteschr = chr class GuessJSONUTFTests(unittest.TestCase): @@ -43,7 +45,7 @@ class GuessJSONUTFTests(unittest.TestCase): guess = requests.utils.guess_json_utf for i in range(1000): sample = bytes().join( - [chr(random.randrange(256)) for _ in range(4)]) + [byteschr(random.randrange(256)) for _ in range(4)]) res = guess(sample) if res is not None and res != 'utf-8': # This should decode without errors if this is *really*