]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Backport Tim's checkin 1.17:
authorThomas Wouters <thomas@python.org>
Wed, 11 Jul 2001 11:38:20 +0000 (11:38 +0000)
committerThomas Wouters <thomas@python.org>
Wed, 11 Jul 2001 11:38:20 +0000 (11:38 +0000)
SF patch #440144:  Tests and minor bugfix for uu module

decode():  While writing tests for uu.py, Nick Mathewson discovered
that the 'Truncated input file' exception could never get raised,
because its "if not str:" test was actually testing the builtin
function "str", not the local string vrbl "s" as intended.

Lib/uu.py

index 334d436cd62233aeab0bf98f1c259052c3a73899..11a4e83f91f084440fb8ad1e1a526a0298ecfb5b 100755 (executable)
--- a/Lib/uu.py
+++ b/Lib/uu.py
@@ -135,7 +135,7 @@ def decode(in_file, out_file=None, mode=None):
             sys.stderr.write("Warning: %s\n" % str(v))
         out_file.write(data)
         s = in_file.readline()
-    if not str:
+    if not s:
         raise Error, 'Truncated input file'
 
 def test():