Jython compatibility fix: if uu.decode() opened its output file, be sure to
close it.
diff --git a/Lib/uu.py b/Lib/uu.py
index 3ccedb0..da89f72 100755
--- a/Lib/uu.py
+++ b/Lib/uu.py
@@ -114,6 +114,7 @@
#
# Open the output file
#
+ opened = False
if out_file == '-':
out_file = sys.stdout
elif isinstance(out_file, basestring):
@@ -123,6 +124,7 @@
except AttributeError:
pass
out_file = fp
+ opened = True
#
# Main decoding loop
#
@@ -140,6 +142,8 @@
s = in_file.readline()
if not s:
raise Error('Truncated input file')
+ if opened:
+ out_file.close()
def test():
"""uuencode/uudecode main program"""