Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load refactor #146

Merged
merged 4 commits into from
Aug 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading