diff options
author | eli.bendersky <devnull@localhost> | 2011-10-31 06:38:41 +0200 |
---|---|---|
committer | eli.bendersky <devnull@localhost> | 2011-10-31 06:38:41 +0200 |
commit | 49f3b63db7e63f38c702676bcd10046b363f1f7f (patch) | |
tree | e19019c3238542bf722fb9d0c1d606f2eec55c50 /_clean_tables.py | |
parent | 171c99fd4dff5deef0ffa868122b66014529f426 (diff) | |
download | pycparser-49f3b63db7e63f38c702676bcd10046b363f1f7f.tar.gz |
Issue 49: Allow dots ('.') in string escapes for the sake of #line directives with Windows paths like "..\..\test"
+ added tests
Diffstat (limited to '_clean_tables.py')
-rw-r--r-- | _clean_tables.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/_clean_tables.py b/_clean_tables.py new file mode 100644 index 0000000..48417b0 --- /dev/null +++ b/_clean_tables.py @@ -0,0 +1,24 @@ +# Cleanup all table and PYC files to ensure no PLY stuff is cached
+#
+import fnmatch
+import os, shutil
+
+file_patterns = ('yacctab.*', 'lextab.*', '*.pyc')
+
+def do_cleanup(root):
+ for path, dirs, files in os.walk(root):
+ for file in files:
+ try:
+ for pattern in file_patterns:
+ if fnmatch.fnmatch(file, pattern):
+ fullpath = os.path.join(path, file)
+ os.remove(fullpath)
+ print 'Deleted', fullpath
+ except OSError:
+ pass
+
+if __name__ == "__main__":
+ do_cleanup('.')
+
+
+
\ No newline at end of file |