summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--django/core/management/commands/makemessages.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/django/core/management/commands/makemessages.py b/django/core/management/commands/makemessages.py
index 4994aaf6ba..a42ba96444 100644
--- a/django/core/management/commands/makemessages.py
+++ b/django/core/management/commands/makemessages.py
@@ -402,7 +402,8 @@ class Command(NoArgsCommand):
elif self.verbosity > 0:
self.stdout.write(errors)
else:
- msgs = open(potfile, 'r').read()
+ with open(potfile, 'r') as fp:
+ msgs = fp.read()
if not self.invoked_for_django:
msgs = self.copy_plural_forms(msgs, locale)
msgs = msgs.replace(