python/samba: PY3 fix can't compare string with int
authorNoel Power <noel.power@suse.com>
Fri, 12 Oct 2018 16:15:39 +0000 (17:15 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 14 Nov 2018 04:07:17 +0000 (05:07 +0100)
Testing a string against an int value is illegal and
is not necessary in this case, this patch removes the
problematic test.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/getopt.py

index db1c175..094031d 100644 (file)
@@ -63,9 +63,6 @@ class SambaOptions(optparse.OptionGroup):
         self._configfile = arg
 
     def _set_debuglevel(self, option, opt_str, arg, parser):
-        if arg < 0:
-            raise optparse.OptionValueError("invalid %s option value: %s" %
-                                            (opt_str, arg))
         self._lp.set('debug level', arg)
         parser.values.debuglevel = arg