summaryrefslogtreecommitdiff
path: root/git/cmd.py
diff options
context:
space:
mode:
authorAndreas Gutsche <andreas.h.gutsche@gmail.com>2011-01-06 14:08:16 +0100
committerAndreas Gutsche <andreas.h.gutsche@gmail.com>2011-01-06 14:08:16 +0100
commit46f63c30e30364eb04160df71056d4d34e97af21 (patch)
tree3e254a23089430eed30306dfd4d45a1736617502 /git/cmd.py
parent294ee691d0fdac46d31550c7f1751d09cfb5a0f0 (diff)
downloadgitpython-46f63c30e30364eb04160df71056d4d34e97af21.tar.gz
Hacked the wait function so that it works with pyside in OS X by using "sleep()".
Diffstat (limited to 'git/cmd.py')
-rw-r--r--git/cmd.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/git/cmd.py b/git/cmd.py
index 60887f5d..d1600b74 100644
--- a/git/cmd.py
+++ b/git/cmd.py
@@ -4,7 +4,7 @@
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
-import os, sys
+import os, sys, platform, time
from util import *
from exc import GitCommandError
@@ -87,6 +87,11 @@ class Git(object):
"""Wait for the process and return its status code.
:raise GitCommandError: if the return status is not 0"""
+
+ #HACK: These two lines are necessary because OSX raises an error if you try to .wait() right after creating the process object.
+ # It is only necessary when using GUI frameworks to instantiate an application.
+ if platform.system().startswith("Darwin") and "pyside" in sys.modules.keys() or "PySide" in sys.modules.keys():
+ time.sleep(0.1)
status = self.proc.wait()
if status != 0:
raise GitCommandError(self.args, status, self.proc.stderr.read())