WIP more prints
This commit is contained in:
parent
f03e82214f
commit
8fffd0fca5
|
@ -327,15 +327,22 @@ if sys.platform == "win32":
|
||||||
source_stat: os.stat_result,
|
source_stat: os.stat_result,
|
||||||
pyc: Path,
|
pyc: Path,
|
||||||
) -> bool:
|
) -> bool:
|
||||||
|
track_debug = getattr(sys, "TRACK_REWRITE", False)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with atomic_write(os.fspath(pyc), mode="wb", overwrite=True) as fp:
|
with atomic_write(os.fspath(pyc), mode="wb", overwrite=True) as fp:
|
||||||
_write_pyc_fp(fp, source_stat, co)
|
_write_pyc_fp(fp, source_stat, co)
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
state.trace(f"error writing pyc file at {pyc}: {e}")
|
state.trace(f"error writing pyc file at {pyc}: {e}")
|
||||||
|
if track_debug:
|
||||||
|
print(f" write_pyc: error! {e}")
|
||||||
|
|
||||||
# we ignore any failure to write the cache file
|
# we ignore any failure to write the cache file
|
||||||
# there are many reasons, permission-denied, pycache dir being a
|
# there are many reasons, permission-denied, pycache dir being a
|
||||||
# file etc.
|
# file etc.
|
||||||
return False
|
return False
|
||||||
|
if track_debug:
|
||||||
|
print(" write_pyc: success")
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue