Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 46f63c3

Browse files
author
Andreas Gutsche
committed
Hacked the wait function so that it works with pyside in OS X by using "sleep()".
1 parent 294ee69 commit 46f63c3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

git/cmd.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# This module is part of GitPython and is released under
55
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
66

7-
import os, sys
7+
import os, sys, platform, time
88
from util import *
99
from exc import GitCommandError
1010

@@ -87,6 +87,11 @@ def wait(self):
8787
"""Wait for the process and return its status code.
8888
8989
:raise GitCommandError: if the return status is not 0"""
90+
91+
#HACK: These two lines are necessary because OSX raises an error if you try to .wait() right after creating the process object.
92+
# It is only necessary when using GUI frameworks to instantiate an application.
93+
if platform.system().startswith("Darwin") and "pyside" in sys.modules.keys() or "PySide" in sys.modules.keys():
94+
time.sleep(0.1)
9095
status = self.proc.wait()
9196
if status != 0:
9297
raise GitCommandError(self.args, status, self.proc.stderr.read())

0 commit comments

Comments
 (0)