diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2011-01-06 15:23:22 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2011-01-06 15:23:22 +0100 |
commit | 1ab169407354d4b9512447cd9c90e8a31263c275 (patch) | |
tree | f757fb9563689031bde22652d06329adfa8f1b5d | |
parent | 56488ced0fae2729b1e9c72447b005efdcd4fea7 (diff) | |
parent | b424f87a276e509dcaaee6beb10ca00c12bb7d29 (diff) | |
download | gitpython-1ab169407354d4b9512447cd9c90e8a31263c275.tar.gz |
Merge remote branch 'ahgutsche/master'
-rw-r--r-- | git/cmd.py | 1 | ||||
-rw-r--r-- | git/diff.py | 3 | ||||
-rw-r--r-- | git/util.py | 10 |
3 files changed, 13 insertions, 1 deletions
@@ -87,6 +87,7 @@ class Git(object): """Wait for the process and return its status code. :raise GitCommandError: if the return status is not 0""" + sleep_on_gui_present_osx_crashfix() status = self.proc.wait() if status != 0: raise GitCommandError(self.args, status, self.proc.stderr.read()) diff --git a/git/diff.py b/git/diff.py index 48253c42..c2597bd9 100644 --- a/git/diff.py +++ b/git/diff.py @@ -10,6 +10,8 @@ from objects.util import mode_str_to_int from exc import GitCommandError from gitdb.util import hex_to_bin + +from util import sleep_on_gui_present_osx_crashfix __all__ = ('Diffable', 'DiffIndex', 'Diff') @@ -99,6 +101,7 @@ class Diffable(object): diff_method = Diff._index_from_patch_format index = diff_method(self.repo, proc.stdout) + sleep_on_gui_present_osx_crashfix() status = proc.wait() return index diff --git a/git/util.py b/git/util.py index 8c0b6697..f81e3741 100644 --- a/git/util.py +++ b/git/util.py @@ -21,7 +21,7 @@ from gitdb.util import ( ) __all__ = ( "stream_copy", "join_path", "to_native_path_windows", "to_native_path_linux", - "join_path_native", "Stats", "IndexFileSHA1Writer", "Iterable", "IterableList", + "join_path_native", "sleep_on_gui_present_osx_crashfix", "Stats", "IndexFileSHA1Writer", "Iterable", "IterableList", "BlockingLockFile", "LockFile", 'Actor', 'get_user_id', 'assure_directory_exists', 'RemoteProgress') @@ -101,6 +101,14 @@ def get_user_id(): # END get username from login return "%s@%s" % (username, platform.node()) +def sleep_on_gui_present_osx_crashfix(): + """This fixes a crash which appears when using pyside on OS X.""" + + #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(): + time.sleep(0.1) + #} END utilities #{ Classes |