Commits

Andrew Kuchling committed c7a8cb0

Jython compatibility fix: if uu.decode() opened its output file, be sure to
close it.

  • Participants
  • Parent commits f3a6318
  • Branches 2.4

Comments (0)

Files changed (1)

     #
     # Open the output file
     #
+    opened = False
     if out_file == '-':
         out_file = sys.stdout
     elif isinstance(out_file, StringType):
         except AttributeError:
             pass
         out_file = fp
+        opened = True
     #
     # Main decoding loop
     #
         s = in_file.readline()
     if not s:
         raise Error, 'Truncated input file'
+    if opened:
+        out_file.close()
 
 def test():
     """uuencode/uudecode main program"""