Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ce5dfe7

Browse filesBrowse files
terminalmageByron
authored andcommitted
Fix exception on import in MacOS
This is related to my fix in #658. Apparently, MacOS adds a git executable that is just a stub which displays an error. This gets past the try/except I added in #658, and allows all of the GitPython components to be imported, but since the executable is not *actually* git, it results in an exception when ``refresh()`` attemepts to run a ``git version``.
1 parent 6c2446f commit ce5dfe7
Copy full SHA for ce5dfe7

File tree

Expand file treeCollapse file tree

1 file changed

+4
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-1
lines changed

‎git/__init__.py

Copy file name to clipboardExpand all lines: git/__init__.py
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,8 @@ def refresh(path=None):
7979
#} END initialize git executable path
8080

8181
#################
82-
refresh()
82+
try:
83+
refresh()
84+
except Exception as exc:
85+
raise ImportError('Failed to initialize: {0}'.format(exc))
8386
#################

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.