From 628c45a4a9ea123f95f8ef8711a0ea579fc8f630 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Sat, 20 Aug 2016 11:02:17 +0200 Subject: [PATCH] Avoid bytecode generation when importing --- git-hg-helper | 1 + git-remote-hg | 1 + 2 files changed, 2 insertions(+) diff --git a/git-hg-helper b/git-hg-helper index 7e72b2e..a49a08d 100755 --- a/git-hg-helper +++ b/git-hg-helper @@ -36,6 +36,7 @@ def log(msg, *args): def import_sibling(mod, filename): import imp mydir = os.path.dirname(__file__) + sys.dont_write_bytecode = True return imp.load_source(mod, os.path.join(mydir, filename)) class GitHgRepo: diff --git a/git-remote-hg b/git-remote-hg index ec27614..f0ce95e 100755 --- a/git-remote-hg +++ b/git-remote-hg @@ -1445,6 +1445,7 @@ def do_push_refspec(parser, refspec, revs): subprocess.check_call(cmd, stdin=None, stdout=tmpfastexport) try: import imp + sys.dont_write_bytecode = True ctx.hghelper = imp.load_source('hghelper', \ os.path.join(os.path.dirname(__file__), 'git-hg-helper')) ctx.hghelper.init_git(gitdir)