summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorBen <Ben@ben-home>2012-02-03 06:24:55 +0200
committerBen <Ben@ben-home>2012-02-03 06:24:55 +0200
commitf86dea169a1568afd44ed3436e93b1718bac7ad1 (patch)
treed88fb11cb528502f50d2ce8db64d5af31b3e916c /examples
parent5cd3fd6478d99b75cdfce8c205c3f06997d9cf1b (diff)
downloadpycparser-f86dea169a1568afd44ed3436e93b1718bac7ad1.tar.gz
1. make examples callable from root dir
2. improve error message displayed to the user when cpp is not found by parse_file
Diffstat (limited to 'examples')
-rw-r--r--examples/c-to-c.py2
-rw-r--r--examples/cdecl.py2
-rw-r--r--examples/explore_ast.py2
-rw-r--r--examples/func_calls.py2
-rw-r--r--examples/func_defs.py2
-rw-r--r--examples/using_cpp_libc.py2
6 files changed, 6 insertions, 6 deletions
diff --git a/examples/c-to-c.py b/examples/c-to-c.py
index acd2cd4..35e1c64 100644
--- a/examples/c-to-c.py
+++ b/examples/c-to-c.py
@@ -13,7 +13,7 @@ import sys
# This is not required if you've installed pycparser into
# your site-packages/ with setup.py
#
-sys.path.insert(0, '..')
+sys.path.extend(['.', '..'])
from pycparser import parse_file, c_parser, c_generator
diff --git a/examples/cdecl.py b/examples/cdecl.py
index 0e07272..8884591 100644
--- a/examples/cdecl.py
+++ b/examples/cdecl.py
@@ -25,7 +25,7 @@ import sys
# This is not required if you've installed pycparser into
# your site-packages/ with setup.py
#
-sys.path.insert(0, '..')
+sys.path.extend(['.', '..'])
from pycparser import c_parser, c_ast
diff --git a/examples/explore_ast.py b/examples/explore_ast.py
index 919f44e..24df79f 100644
--- a/examples/explore_ast.py
+++ b/examples/explore_ast.py
@@ -18,7 +18,7 @@ import sys
# This is not required if you've installed pycparser into
# your site-packages/ with setup.py
#
-sys.path.insert(0, '..')
+sys.path.extend(['.', '..'])
from pycparser import c_parser, c_ast
diff --git a/examples/func_calls.py b/examples/func_calls.py
index f79d47e..f8ff731 100644
--- a/examples/func_calls.py
+++ b/examples/func_calls.py
@@ -13,7 +13,7 @@ import sys
# This is not required if you've installed pycparser into
# your site-packages/ with setup.py
#
-sys.path.insert(0, '..')
+sys.path.extend(['.', '..'])
from pycparser import c_parser, c_ast, parse_file
diff --git a/examples/func_defs.py b/examples/func_defs.py
index 9522382..c42d5c0 100644
--- a/examples/func_defs.py
+++ b/examples/func_defs.py
@@ -16,7 +16,7 @@ import sys
# This is not required if you've installed pycparser into
# your site-packages/ with setup.py
#
-sys.path.insert(0, '..')
+sys.path.extend(['.', '..'])
from pycparser import c_parser, c_ast, parse_file
diff --git a/examples/using_cpp_libc.py b/examples/using_cpp_libc.py
index fa9e6a7..1c28c7a 100644
--- a/examples/using_cpp_libc.py
+++ b/examples/using_cpp_libc.py
@@ -13,7 +13,7 @@ import sys
# This is not required if you've installed pycparser into
# your site-packages/ with setup.py
#
-sys.path.insert(0, '..')
+sys.path.extend(['.', '..'])
# Portable cpp path for Windows and Linux/Unix
CPPPATH = '../utils/cpp.exe' if sys.platform == 'win32' else 'cpp'