summaryrefslogtreecommitdiff
path: root/kpov_judge/instructions_extractor.py
diff options
context:
space:
mode:
Diffstat (limited to 'kpov_judge/instructions_extractor.py')
-rw-r--r--kpov_judge/instructions_extractor.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/kpov_judge/instructions_extractor.py b/kpov_judge/instructions_extractor.py
index b1644b2..f747c1a 100644
--- a/kpov_judge/instructions_extractor.py
+++ b/kpov_judge/instructions_extractor.py
@@ -22,8 +22,9 @@ def print_instructions(p, fname):
print(" - ".join(l1))
with open(os.path.join(p, fname)) as f:
task_code = compile(f.read(), fname, 'exec')
- exec(task_code)
- for lang, text in instructions.items():
+ d = {}
+ exec(task_code, globals(), d)
+ for lang, text in d['instructions'].items():
print("Language: {0}".format(lang))
print(text.encode('utf-8'))
print("")