aboutsummaryrefslogtreecommitdiff
path: root/pycparser/_build_tables.py
diff options
context:
space:
mode:
Diffstat (limited to 'pycparser/_build_tables.py')
-rw-r--r--pycparser/_build_tables.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/pycparser/_build_tables.py b/pycparser/_build_tables.py
index 94a3891..958381a 100644
--- a/pycparser/_build_tables.py
+++ b/pycparser/_build_tables.py
@@ -10,13 +10,17 @@
# License: BSD
#-----------------------------------------------------------------
+# Insert '.' and '..' as first entries to the search path for modules.
+# Restricted environments like embeddable python do not include the
+# current working directory on startup.
+import sys
+sys.path[0:0] = ['.', '..']
+
# Generate c_ast.py
from _ast_gen import ASTCodeGenerator
ast_gen = ASTCodeGenerator('_c_ast.cfg')
ast_gen.generate(open('c_ast.py', 'w'))
-import sys
-sys.path[0:0] = ['.', '..']
from pycparser import c_parser
# Generates the tables