diff options
author | Guido Günther <agx@sigxcpu.org> | 2014-04-03 00:04:18 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2014-04-03 18:05:33 +0200 |
commit | b393080ac3b98342b53849d14049db024183f0cb (patch) | |
tree | c3fd85d5f456bbc707f1471bf2bead71ec1b8891 | |
parent | 4131b900ee99f62ba7a1910b18bd55c669a0ca9c (diff) |
Import command not module
This matches the function name
-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 4f2721f3..2eb64de2 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() |