From e7728c38ae4c9b2adfadf04b1b1feba4ef2741ff Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Tue, 24 Aug 2021 14:20:40 -0700 Subject: [PATCH] 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 --- git-filter-repo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-filter-repo b/git-filter-repo index b91bd96..6248db7 100755 --- a/git-filter-repo +++ b/git-filter-repo @@ -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.