logo

deblob

remove binary executables from a directory git clone https://anongit.hacktivis.me/git/deblob.git/

python_compile.py (522B)


  1. #!/usr/bin/python
  2. # SPDX-FileCopyrightText: 2019 deblob Authors <https://hacktivis.me/projects/deblob>
  3. # SPDX-License-Identifier: BSD-3-Clause
  4. import py_compile
  5. import sys
  6. for check in py_compile.PycInvalidationMode:
  7. name = check.name.lower()
  8. value = check.value
  9. src_file = "./test/fixtures/hello.py"
  10. dest_file = "./test/fixtures/pyc/hello.{}.{}.pyc".format(
  11. name, sys.implementation.cache_tag
  12. )
  13. print(dest_file)
  14. py_compile.compile(src_file, cfile=dest_file, invalidation_mode=check)