← 返回首页
Merge pull request #658 from terminalmage/issue657 · gitpython-developers/GitPython@8ef53c5 · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

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

Provide feedback

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

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

Commit 8ef53c5

Browse files
authored
Merge pull request #658 from terminalmage/issue657
Fix GitError being raised in initial `import git`
2 parents a5f0343 + 0b6cde8 commit 8ef53c5

1 file changed

Lines changed: 20 additions & 17 deletions

File tree

‎git/__init__.py‎

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,26 @@ def _init_externals():
3535

3636
#{ Imports
3737

38-
from git.config import GitConfigParser # @NoMove @IgnorePep8
39-
from git.objects import * # @NoMove @IgnorePep8
40-
from git.refs import * # @NoMove @IgnorePep8
41-
from git.diff import * # @NoMove @IgnorePep8
42-
from git.exc import * # @NoMove @IgnorePep8
43-
from git.db import * # @NoMove @IgnorePep8
44-
from git.cmd import Git # @NoMove @IgnorePep8
45-
from git.repo import Repo # @NoMove @IgnorePep8
46-
from git.remote import * # @NoMove @IgnorePep8
47-
from git.index import * # @NoMove @IgnorePep8
48-
from git.util import ( # @NoMove @IgnorePep8
49-
LockFile,
50-
BlockingLockFile,
51-
Stats,
52-
Actor,
53-
rmtree,
54-
)
38+
from git.exc import * # @NoMove @IgnorePep8
39+
try:
40+
from git.config import GitConfigParser # @NoMove @IgnorePep8
41+
from git.objects import * # @NoMove @IgnorePep8
42+
from git.refs import * # @NoMove @IgnorePep8
43+
from git.diff import * # @NoMove @IgnorePep8
44+
from git.db import * # @NoMove @IgnorePep8
45+
from git.cmd import Git # @NoMove @IgnorePep8
46+
from git.repo import Repo # @NoMove @IgnorePep8
47+
from git.remote import * # @NoMove @IgnorePep8
48+
from git.index import * # @NoMove @IgnorePep8
49+
from git.util import ( # @NoMove @IgnorePep8
50+
LockFile,
51+
BlockingLockFile,
52+
Stats,
53+
Actor,
54+
rmtree,
55+
)
56+
except GitError as exc:
57+
raise ImportError('%s: %s' % (exc.__class__.__name__, exc))
5558

5659
#} END imports
5760

0 commit comments

Comments
 (0)

Footer

© 2026 GitHub, Inc.