diff options
Diffstat (limited to 'gbp/scripts')
-rw-r--r-- | gbp/scripts/supercommand.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gbp/scripts/supercommand.py b/gbp/scripts/supercommand.py index 4f2721f..2eb64de 100644 --- a/gbp/scripts/supercommand.py +++ b/gbp/scripts/supercommand.py @@ -44,10 +44,11 @@ The most commonly used commands are: import-dscs - import multiple Debian source packages """ -def import_command(modulename): +def import_command(cmd): """ Import the module that implements the given command """ + modulename = sanitize(cmd) if (not re.match(r'[a-z][a-z0-9_]', modulename) or modulename in invalid_modules): raise ImportError('Illegal module name %s' % modulename) @@ -69,9 +70,8 @@ def supercommand(argv=None): usage() return 0 - modulename = sanitize(cmd) try: - module = import_command(modulename) + module = import_command(cmd) except ImportError as e: print >>sys.stderr, "'%s' is not a valid command." % cmd usage() |