# # A sitecustomize.py for versions of Python with ctypes. # Prevents Python from finding lone .pyc files. # Put it anywhere in your sys.path. # Only works if you have ctypes. # import sys if '__pypy__' not in sys.builtin_module_names: try: import ctypes except ImportError: ctypes = None if getattr(ctypes, 'pythonapi', None) is not None: class S(ctypes.Structure): _fields_ = [('suffix', ctypes.c_char_p), ('mode', ctypes.c_char_p), ('type', ctypes.c_int)] p = ctypes.POINTER(S).in_dll(ctypes.pythonapi, '_PyImport_Filetab') for s in p: if not s.suffix: break if s.suffix == '.pyc': s.suffix = '\xFF'