forked from extern/django-helpdesk
Merge pull request #446 from flinz/patches/open-file
patch: implicit closing of open files
This commit is contained in:
commit
dcbe9d1fed
@ -234,7 +234,7 @@ def process_queue(q, logger):
|
||||
logger.info("Found %s messages in local mailbox directory" % str(len(mail)))
|
||||
for m in mail:
|
||||
logger.info("Processing message %s" % str(m))
|
||||
f = open(m, 'r')
|
||||
with open(m, 'r') as f:
|
||||
ticket = ticket_from_message(message=f.read(), queue=q, logger=logger)
|
||||
if ticket:
|
||||
logger.info("Successfully processed message %s, ticket/comment created." % str(m))
|
||||
|
Loading…
Reference in New Issue
Block a user