Skip to content

Commit

Permalink
Fix crazy [Access is denied] error on TC run on Windows OS
Browse files Browse the repository at this point in the history
  • Loading branch information
greenozon committed Aug 17, 2024
1 parent 025b797 commit 4ebd41f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion xdis/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import tempfile
import types
from datetime import datetime
from os import close
from struct import pack, unpack

import xdis.marsh
Expand Down Expand Up @@ -84,7 +85,8 @@ def check_object_path(path):
spath = path
else:
spath = path.decode("utf-8")
path = tempfile.mkstemp(prefix=basename + "-", suffix=".pyc", text=False)[1]
fd, path = tempfile.mkstemp(prefix=basename + "-", suffix=".pyc", text=False)
close(fd)
py_compile.compile(spath, cfile=path, doraise=True)

if not is_bytecode_extension(path):
Expand Down

0 comments on commit 4ebd41f

Please sign in to comment.