--- Tools/scripts/h2py.py.t 2020-03-23 20:32:19.040847247 -0700 +++ Tools/scripts/h2py.py 2020-03-23 20:32:22.884906477 -0700 @@ -21,7 +21,7 @@ # - what to do about #if(def)? # - what to do about macros with multiple parameters? -import sys, re, getopt, os +import sys, re, getopt, os, stat p_define = re.compile('^[\t ]*#[\t ]*define[\t ]+([a-zA-Z0-9_]+)[\t ]+') @@ -141,7 +141,10 @@ inclfp = None for dir in searchdirs: try: - inclfp = open(dir + '/' + filename) + inclpath = dir + '/' + filename + if stat.S_ISDIR(os.stat('/etc')[stat.ST_MODE]): + continue + inclfp = open(inclpath) break except IOError: pass