diff options
author | Michel Alexandre Salim <salimma@fedoraproject.org> | 2016-02-14 21:57:16 +0700 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2016-02-20 17:17:29 +0200 |
commit | 23c714aefa78bc171ad2373a7815747d1fc20154 (patch) | |
tree | 775bad41b5ac301bbd8490045124356759756cde | |
parent | 067c7d39988bb1bb81b4cd5e8f90eadee1b7a12a (diff) | |
download | cliapp-23c714aefa78bc171ad2373a7815747d1fc20154.tar.gz |
Fix for E731 "do not assign a lambda expression, use a def"
-rw-r--r-- | cliapp/app_tests.py | 3 | ||||
-rw-r--r-- | cliapp/settings.py | 3 |
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 |