summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cliapp/app_tests.py3
-rw-r--r--cliapp/settings.py3
2 files changed, 4 insertions, 2 deletions
diff --git a/cliapp/app_tests.py b/cliapp/app_tests.py
index fde0916..6e87bbd 100644
--- a/cliapp/app_tests.py
+++ b/cliapp/app_tests.py
@@ -362,6 +362,7 @@ class ExtensibleSubcommandTests(unittest.TestCase):
self.assertEqual(self.app.subcommands, {})
def test_adds_subcommand(self):
- help_callback = lambda args: None
+ def help_callback(arg):
+ pass
self.app.add_subcommand('foo', help_callback)
self.assertEqual(self.app.subcommands, {'foo': help_callback})
diff --git a/cliapp/settings.py b/cliapp/settings.py
index e281099..f92fb78 100644
--- a/cliapp/settings.py
+++ b/cliapp/settings.py
@@ -466,7 +466,8 @@ class Settings(object):
'''Build OptionParser for parsing command line.'''
# Call a callback function unless we're in configs_only mode.
- maybe = lambda func: (lambda *args: None) if configs_only else func
+ def maybe(func):
+ return (lambda *args: None) if configs_only else func
# Maintain lists of callback function calls that are deferred.
# We call them ourselves rather than have OptionParser call them