if sys.platform[:3] == 'win':
p = subprocess.Popen(cmdline)
else:
- setsid = getattr(os, 'setsid', None)
- if not setsid:
- setsid = getattr(os, 'setpgrp', None)
- p = subprocess.Popen(cmdline, close_fds=True, preexec_fn=setsid)
+ p = subprocess.Popen(cmdline, close_fds=True,
+ start_new_session=True)
return (p.poll() is None)
except OSError:
return False
action = "openURL"
devnull = subprocess.DEVNULL
- # if possible, put browser in separate process group, so
- # keyboard interrupts don't affect browser as well as Python
- setsid = getattr(os, 'setsid', None)
- if not setsid:
- setsid = getattr(os, 'setpgrp', None)
try:
p = subprocess.Popen(["kfmclient", action, url],
p = subprocess.Popen(["konqueror", "--silent", url],
close_fds=True, stdin=devnull,
stdout=devnull, stderr=devnull,
- preexec_fn=setsid)
+ start_new_session=True)
except OSError:
# fall through to next variant
pass
p = subprocess.Popen(["kfm", "-d", url],
close_fds=True, stdin=devnull,
stdout=devnull, stderr=devnull,
- preexec_fn=setsid)
+ start_new_session=True)
except OSError:
return False
else: