We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c23ab5f commit 431d898Copy full SHA for 431d898
1 file changed
scripts/cfn
@@ -37,16 +37,21 @@ def render_python_template(file):
37
# just capture sys.stdout.
38
39
from cStringIO import StringIO
40
- import sys
+ import os
41
import runpy
42
+ import sys
43
44
capture = StringIO()
45
+ orig_path = sys.path
46
47
try:
48
+ sys.path = sys.path[:]
49
+ sys.path[0] = os.path.dirname(file)
50
sys.stdout = capture
51
runpy.run_path(file)
52
finally:
53
sys.stdout = sys.__stdout__
54
+ sys.path = orig_path
55
res = capture.getvalue()
56
capture.close()
57
0 commit comments