From f86dea169a1568afd44ed3436e93b1718bac7ad1 Mon Sep 17 00:00:00 2001 From: Ben Date: Fri, 3 Feb 2012 06:24:55 +0200 Subject: 1. make examples callable from root dir 2. improve error message displayed to the user when cpp is not found by parse_file --- examples/c-to-c.py | 2 +- examples/cdecl.py | 2 +- examples/explore_ast.py | 2 +- examples/func_calls.py | 2 +- examples/func_defs.py | 2 +- examples/using_cpp_libc.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) (limited to 'examples') 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' -- cgit v1.2.3