Skip to content

Commit 89686b8

Browse files
committed
Update _get_code_from_file for Python 3.12.6
python/cpython#107644
1 parent ed524c6 commit 89686b8

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

hy/compat.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
PY3_10 = sys.version_info >= (3, 10)
77
PY3_11 = sys.version_info >= (3, 11)
88
PY3_12 = sys.version_info >= (3, 12)
9+
PY3_12_6 = sys.version_info >= (3, 12, 6)
910
PYPY = platform.python_implementation() == "PyPy"
1011
PYODIDE = platform.system() == "Emscripten"
1112

hy/importer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def _get_code_from_file(run_name, fname=None, hy_src_check=lambda x: x.endswith(
9999
source = f.read().decode("utf-8")
100100
code = compile(source, fname, "exec")
101101

102-
return (code, fname)
102+
return code if hy.compat.PY3_12_6 else (code, fname)
103103

104104

105105
importlib.machinery.SOURCE_SUFFIXES.insert(0, ".hy")

0 commit comments

Comments
 (0)