scanner: Fix optparse on early 2.6 (#302)
This commit is contained in:
parent
5ff8ea451f
commit
ef3d5e92ce
@ -79,12 +79,15 @@ def main():
|
||||
def parse_options():
|
||||
parser = optparse.OptionParser(
|
||||
version='Mopidy %s' % versioning.get_version())
|
||||
# NOTE Python 2.6: To support Python versions < 2.6.2rc1 we must use
|
||||
# bytestrings for the first argument to ``add_option``
|
||||
# See https://github.com/mopidy/mopidy/issues/302 for details
|
||||
parser.add_option(
|
||||
'-q', '--quiet',
|
||||
b'-q', '--quiet',
|
||||
action='store_const', const=0, dest='verbosity_level',
|
||||
help='less output (warning level)')
|
||||
parser.add_option(
|
||||
'-v', '--verbose',
|
||||
b'-v', '--verbose',
|
||||
action='count', default=1, dest='verbosity_level',
|
||||
help='more output (debug level)')
|
||||
return parser.parse_args(args=mopidy_args)[0]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user