From b393080ac3b98342b53849d14049db024183f0cb Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Thu, 3 Apr 2014 00:04:18 +0200 Subject: Import command not module This matches the function name --- gbp/scripts/supercommand.py | 6 +++--- 1 file 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() -- cgit v1.2.3