]> git.phdru.name Git - mimedecode.git/blobdiff - mimedecode.py
Use \n instead of os.linesep
[mimedecode.git] / mimedecode.py
index 21ab3717a6a96386213d55462bd245d6c3d3d552..37fa212f6b5d44310657749f692496dd0e91676a 100755 (executable)
@@ -41,7 +41,7 @@ def output(s, outfile=sys.stdout):
 def output_headers(msg, outfile=sys.stdout):
     unix_from = msg.get_unixfrom()
     if unix_from:
-        output(unix_from + os.linesep)
+        output(unix_from + '\n')
     for key, value in msg.items():
         output("%s: %s\n" % (key, value), outfile)
     output("\n", outfile) # End of headers
@@ -350,11 +350,9 @@ if __name__ == "__main__":
     arguments = init()
 
     la = len(arguments)
-    if la == 0:
-        infile = sys.stdin
-    elif la <> 1:
+    if la >= 2:
         usage(1)
-    elif arguments[0] == '-':
+    if (la == 0) or (arguments[0] == '-'):
         infile = sys.stdin
     else:
         infile = open(arguments[0], 'r')