Calculate the version from the module, not the entry_point

When git-filter-repo is installed, sys.argv[0] will be an entry-point
stub, not the relevant Python module.

Signed-off-by: Stefano Rivera <stefano@rivera.za.net>
pull/277/head
Stefano Rivera 3 years ago
parent c5af37f82c
commit e7728c38ae

@ -1597,7 +1597,7 @@ class GitUtils(object):
@staticmethod
def print_my_version():
with open(sys.argv[0], 'br') as f:
with open(__file__, 'br') as f:
contents = f.read()
# If people replaced @@LOCALEDIR@@ string to point at their local
# directory, undo it so we can get original source version.

Loading…
Cancel
Save