Avoid bytecode generation when importing

This commit is contained in:
Mark Nauwelaerts
2016-08-20 11:02:17 +02:00
parent 55689eb0a8
commit 628c45a4a9
2 changed files with 2 additions and 0 deletions

View File

@@ -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:

View File

@@ -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)