##// END OF EJS Templates
procutil: try and avoid angering CoreFoundation on macOS...
Augie Fackler -
r44364:a89381e0 default
parent child Browse files
Show More
@@ -423,7 +423,10 b' def system(cmd, environ=None, cwd=None, '
423 423 return rc
424 424
425 425
426 def gui():
426 _is_gui = None
427
428
429 def _gui():
427 430 '''Are we running in a GUI?'''
428 431 if pycompat.isdarwin:
429 432 if b'SSH_CONNECTION' in encoding.environ:
@@ -439,6 +442,13 b' def gui():'
439 442 return pycompat.iswindows or encoding.environ.get(b"DISPLAY")
440 443
441 444
445 def gui():
446 global _is_gui
447 if _is_gui is None:
448 _is_gui = _gui()
449 return _is_gui
450
451
442 452 def hgcmd():
443 453 """Return the command used to execute current hg
444 454
@@ -583,6 +593,11 b' else:'
583 593 `Subprocess.wait` function for the spawned process. This is mostly
584 594 useful for developers that need to make sure the spawned process
585 595 finished before a certain point. (eg: writing test)'''
596 if pycompat.isdarwin:
597 # avoid crash in CoreFoundation in case another thread
598 # calls gui() while we're calling fork().
599 gui()
600
586 601 # double-fork to completely detach from the parent process
587 602 # based on http://code.activestate.com/recipes/278731
588 603 if record_wait is None:
General Comments 0
You need to be logged in to leave comments. Login now