PyBitmessage-2021-04-27/build/compiletest.py

24 lines
659 B
Python
Raw Permalink Normal View History

#!/usr/bin/python2.7
import ctypes
import fnmatch
import os
import sys
import traceback
matches = []
for root, dirnames, filenames in os.walk('src'):
for filename in fnmatch.filter(filenames, '*.py'):
matches.append(os.path.join(root, filename))
for filename in matches:
source = open(filename, 'r').read() + '\n'
try:
compile(source, filename, 'exec')
except Exception as e:
2017-01-11 14:21:53 +01:00
if 'win' in sys.platform:
ctypes.windll.user32.MessageBoxA(0, traceback.format_exc(), "Exception in " + filename, 1)
else:
print "Exception in %s: %s" % (filename, traceback.format_exc())
sys.exit(1)