diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-06-30 18:21:39 +0200 |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-06-30 18:21:39 +0200 |
commit | a34dbd8085b405901a76671a6b8cedc98e23d05d (patch) | |
tree | 17d72ab702f9007417eca4cfce3397476ee3666b /Lib/test/test_threading.py | |
parent | 8203f2c3a1d1c48d153ef333635d099c97e69381 (diff) | |
parent | 160f374a62b3a6871fb7fe8bb988d2836b602277 (diff) | |
download | cpython-a34dbd8085b405901a76671a6b8cedc98e23d05d.tar.gz |
(merge 3.2) Issue #12451: Open files in binary mode in some tests when the text
file is not needed.
Remove also an unused variable (blank) in test_threading.
Diffstat (limited to 'Lib/test/test_threading.py')
-rw-r--r-- | Lib/test/test_threading.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py index 12e596e053..2271f4e521 100644 --- a/Lib/test/test_threading.py +++ b/Lib/test/test_threading.py @@ -650,11 +650,10 @@ class ThreadJoinOnShutdown(BaseTestCase): def random_io(): '''Loop for a while sleeping random tiny amounts and doing some I/O.''' - blank = b'x' * 200 while True: - in_f = open(os.__file__, 'r') + in_f = open(os.__file__, 'rb') stuff = in_f.read(200) - null_f = open(os.devnull, 'w') + null_f = open(os.devnull, 'wb') null_f.write(stuff) time.sleep(random.random() / 1995) null_f.close() |