diff --git a/lbry/lbry/conf.py b/lbry/lbry/conf.py index 4beb4b34d..2ccc78a27 100644 --- a/lbry/lbry/conf.py +++ b/lbry/lbry/conf.py @@ -148,10 +148,12 @@ class MaxKeyFee(Setting[dict]): @staticmethod def _parse_list(l): - if len(l) == 1 and (l[0] == 'null' or not l[0]): + if len(l) == 1 and l[0] == 'null': return None - assert len(l) == 2, ('Max key fee is made up of either two values: ' - '"AMOUNT CURRENCY", or "null" (to set no limit)') + assert len(l) == 2, ( + 'Max key fee is made up of either two values: ' + '"AMOUNT CURRENCY", or "null" (to set no limit)' + ) try: amount = float(l[0]) except ValueError: @@ -162,8 +164,8 @@ class MaxKeyFee(Setting[dict]): return {'amount': amount, 'currency': currency} def deserialize(self, value): - if not value: - return None + if value is None: + return if isinstance(value, dict): return { 'currency': value['currency'], diff --git a/lbry/tests/unit/test_conf.py b/lbry/tests/unit/test_conf.py index 17a347a1a..3ec10701e 100644 --- a/lbry/tests/unit/test_conf.py +++ b/lbry/tests/unit/test_conf.py @@ -231,10 +231,6 @@ class ConfigurationTests(unittest.TestCase): c = Config.create_from_arguments(args) self.assertEqual(c.max_key_fee, None) - args = parser.parse_args(['--max-key-fee', '']) - c = Config.create_from_arguments(args) - self.assertEqual(c.max_key_fee, None) - # set args = parser.parse_args(['--max-key-fee', '1.0', 'BTC']) c = Config.create_from_arguments(args)