From 9b762d170a9d895eadae270569c1dee6dbd976c5 Mon Sep 17 00:00:00 2001 From: Ramiro Morales Date: Sat, 4 Feb 2012 22:12:58 +0000 Subject: [PATCH] Made a couple of idiomatic changes in makemessages. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17449 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/management/commands/makemessages.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/django/core/management/commands/makemessages.py b/django/core/management/commands/makemessages.py index 2a814f0708..24d5beaa63 100644 --- a/django/core/management/commands/makemessages.py +++ b/django/core/management/commands/makemessages.py @@ -46,10 +46,12 @@ def _popen(cmd): return p.communicate() def walk(root, topdown=True, onerror=None, followlinks=False, - ignore_patterns=[], verbosity=0, stdout=sys.stdout): + ignore_patterns=None, verbosity=0, stdout=sys.stdout): """ A version of os.walk that can follow symlinks for Python < 2.6 """ + if ignore_patterns is None: + ignore_patterns = [] dir_suffix = '%s*' % os.sep norm_patterns = map(lambda p: p.endswith(dir_suffix) and p[:-len(dir_suffix)] or p, ignore_patterns) @@ -391,9 +393,10 @@ class Command(NoArgsCommand): no_location = options.get('no_location') no_obsolete = options.get('no_obsolete') if domain == 'djangojs': - extensions = handle_extensions(extensions or ['js']) + exts = extensions if extensions else ['js'] else: - extensions = handle_extensions(extensions or ['html', 'txt']) + exts = extensions if extensions else ['html', 'txt'] + extensions = handle_extensions(exts) if verbosity > 1: self.stdout.write('examining files with the extensions: %s\n'