import sys, os, re, email
from email.Header import decode_header, make_header
from mailbox import UnixMailbox
+from StringIO import StringIO
from optparse import OptionParser, make_option
from stgit.commands.common import *
if filename:
f = file(filename, 'rb')
else:
- f = sys.stdin
+ f = StringIO(sys.stdin.read())
try:
mbox = UnixMailbox(f, email.message_from_file)
__create_patch(None, message, author_name, author_email,
author_date, diff, options)
- if filename:
- f.close()
+ f.close()
def func(parser, options, args):
"""Import a GNU diff file as a new patch