Created
June 21, 2018 23:17
-
-
Save ahcode0919/e4008340222e99fd6c14494b26585215 to your computer and use it in GitHub Desktop.
Check all python file in current directory tree for compilation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import compileall | |
import os | |
import sys | |
# Get path of this file's directory | |
directory = os.path.dirname(os.path.realpath(__file__)) | |
# Check that files are compileable | |
success = compileall.compile_dir(dir=directory, maxlevels=20, force=True) | |
# Return appropriate exit code | |
sys.exit(0) if success else sys.exit(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment