Revert "Clear Python 2 .pyc files when Python 3 suite runs"

This reverts commit 7a60cfd171.
This commit is contained in:
Erik Johnson 2017-12-19 21:38:15 -06:00
parent dafd2fc61f
commit 8c360dd3fb
No known key found for this signature in database
GPG key ID: 5E5583C437808F3F

View file

@ -16,17 +16,6 @@ if os.name == 'nt':
TESTS_DIR = TESTS_DIR.replace('\\', '\\\\')
CODE_DIR = os.path.dirname(TESTS_DIR)
if sys.version_info.major == 3:
# Clean up any Python 2 byte-compiled files, as they will cause problems
# when Python 3 tries to import modules.
for root, _, files in os.walk(os.path.dirname(TESTS_DIR)):
if os.path.basename(root) == '__pycache__':
# Ignore byte-compiled files in Python 3 __pycache__ dirs
continue
for filename in files:
if filename.endswith('.pyc'):
os.remove(os.path.join(root, filename))
# Let's inject CODE_DIR so salt is importable if not there already
if '' in sys.path:
sys.path.remove('')