diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-06-30 16:21:39 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-06-30 16:21:39 (GMT) |
commit | 2f655b73e4903a218e09cb4c58f7a2b8a706582a (patch) | |
tree | ad17879220d57e7b4048d175d03f9316c02f25f7 /Lib/test/test_threading.py | |
parent | 3909da7fca2ef92b8483f39b7cf89cac4b6e4826 (diff) | |
parent | a6d2c769fb38129b6654f8e4ad5b6b27af182f2c (diff) | |
download | cpython-2f655b73e4903a218e09cb4c58f7a2b8a706582a.zip cpython-2f655b73e4903a218e09cb4c58f7a2b8a706582a.tar.gz cpython-2f655b73e4903a218e09cb4c58f7a2b8a706582a.tar.bz2 |
(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 12e596e..2271f4e 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() |