Skip to content

Commit

Permalink
Do not use is not for string comparisons
Browse files Browse the repository at this point in the history
  • Loading branch information
JayFoxRox authored and mborgerson committed Jan 2, 2020
1 parent 384f3a9 commit e4ca7bd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def genArg(settings, name, port):
'Gamepad #1': 'usb-xbox-gamepad-sdl,index=1',
'Gamepad #2': 'usb-xbox-gamepad-sdl,index=2',
'Gamepad #3': 'usb-xbox-gamepad-sdl,index=3'}.get(settings.settings[name], '')
if arg is not '':
if arg != '':
return ['-device', 'usb-hub,port=' + str(port), '-device'] + [arg + ',port=' + str(port) + ".1"]
return []

Expand All @@ -199,7 +199,7 @@ def escape_path(path):

def genArg(settings, name, port):
port_arr = ['controller_three', 'controller_four', 'controller_one', 'controller_two']
if settings.settings[name] is not '' and settings.settings[port_arr[int(port[:1]) - 1]] != 'Not connected':
if settings.settings[name] != '' and settings.settings[port_arr[int(port[:1]) - 1]] != 'Not connected':
check_path(settings.settings[name])
return ['-drive', 'if=none,id=' + name + ',file=' + escape_path(settings.settings[name]),
'-device', 'usb-storage,drive=' + name + ',port=' + port]
Expand Down Expand Up @@ -241,7 +241,7 @@ def escape_path(path):
check_path(settings.settings['dvd_path'])
dvd_path_arg = ',file=' + escape_path(settings.settings['dvd_path'])

extra_args = [x for x in settings.settings['extra_args'].split(' ') if x is not '']
extra_args = [x for x in settings.settings['extra_args'].split(' ') if x != '']

# Build qemu launch cmd
cmd = [xqemu_path,
Expand Down

0 comments on commit e4ca7bd

Please sign in to comment.