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

Skip to content

Commit cd7e2b2

Browse files
committed
make pygit2 work with pyinstaller
1 parent 1f755c6 commit cd7e2b2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pygit2/_utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,10 @@ def get_ffi():
8080

8181
# Load C definitions
8282
if getattr(sys, 'frozen', False):
83-
dir_path = dirname(abspath(sys.executable))
83+
if hasattr(sys, '_MEIPASS'):
84+
dir_path = sys._MEIPASS
85+
else:
86+
dir_path = dirname(abspath(sys.executable))
8487
else:
8588
dir_path = dirname(abspath(__file__))
8689

0 commit comments

Comments
 (0)