Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiomb2 committed Jan 22, 2018
1 parent f00b63c commit 5b4f37a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mock/py/mockchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ def add_local_repo(infile, destfile, baseurl, repoid=None):

try:
with open(infile) as f:
code = compile(f.read(), infile, 'exec')
content = f.read()
content = re.sub(r'include\((.*)\)', r'exec(open(\g<1>).read(), {}, locals())', content)
code = compile(content, infile, 'exec')
# pylint: disable=exec-used
exec(code)
if not repoid:
Expand Down

0 comments on commit 5b4f37a

Please sign in to comment.