Land #5220, @bcook-r7's fix for OSX forking pymet

Fixes 5013
bug/bundler_fix
Spencer McIntyre 2015-04-21 20:57:23 -04:00
commit 76cdd28e4d
No known key found for this signature in database
GPG Key ID: C00D6B6AA5E15412
1 changed files with 2 additions and 1 deletions

View File

@ -22,6 +22,7 @@ else:
# this MUST be imported for urllib to work on OSX
try:
import SystemConfiguration as osxsc
osxsc.SCNetworkInterfaceCopyAll()
has_osxsc = True
except ImportError:
has_osxsc = False
@ -749,7 +750,7 @@ class PythonMeterpreter(object):
resp = struct.pack('>I', len(resp) + 4) + resp
return resp
if not hasattr(os, 'fork') or has_osxsc or (hasattr(os, 'fork') and os.fork() == 0):
if not hasattr(os, 'fork') or (hasattr(os, 'fork') and os.fork() == 0):
if hasattr(os, 'setsid'):
try:
os.setsid()