From 047979e3d5d30feee560f98c9c8d65029a4cbe37 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Fri, 5 Jun 1992 15:13:53 +0000 Subject: [PATCH] Fix regexp recognizing comments to cope with unterminated comments. --- Tools/scripts/h2py.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Tools/scripts/h2py.py b/Tools/scripts/h2py.py index ff2afc24d06..2fc26d81f86 100755 --- a/Tools/scripts/h2py.py +++ b/Tools/scripts/h2py.py @@ -1,4 +1,3 @@ -#! /ufs/guido/bin/sgi/python #! /usr/local/python # Read #define's from stdin and translate to Python code on stdout. @@ -18,7 +17,7 @@ p_define = regex.compile('^#[\t ]*define[\t ]+\([a-zA-Z0-9_]+\)[\t ]+') -p_comment = regex.compile('/\*\([^*]+\|\*+[^/]\)*\*+/') +p_comment = regex.compile('/\*\([^*]+\|\*+[^/]\)*\(\*+/\)?') def main(): process(sys.stdin)