Skip to content

Commit 85a2268

Browse files
committed
fix: Python 3.14 name change
Signed-off-by: Henry Schreiner <[email protected]>
1 parent ca2b96f commit 85a2268

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
strategy:
3131
fail-fast: false
3232
matrix:
33-
runs-on: [ubuntu-24.04, windows-2022, macos-14]
33+
runs-on: [ubuntu-24.04, windows-2022, macos-13]
3434
python:
3535
- '3.8'
3636
- '3.13'

include/pybind11/eval.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,12 @@ object eval_file(str fname, object global = globals(), object local = object())
133133

134134
int closeFile = 1;
135135
std::string fname_str = (std::string) fname;
136-
FILE *f = _Py_fopen_obj(fname.ptr(), "r");
136+
FILE *f =
137+
# if PY_VERSION_HEX >= 0x030E0000
138+
Py_fopen(fname.ptr(), "r");
139+
# else
140+
_Py_fopen_obj(fname.ptr(), "r");
141+
# endif
137142
if (!f) {
138143
PyErr_Clear();
139144
pybind11_fail("File \"" + fname_str + "\" could not be opened!");

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ classifiers =
2020
Programming Language :: Python :: 3.11
2121
Programming Language :: Python :: 3.12
2222
Programming Language :: Python :: 3.13
23+
Programming Language :: Python :: 3.14
2324
License :: OSI Approved :: BSD License
2425
Programming Language :: Python :: Implementation :: PyPy
2526
Programming Language :: Python :: Implementation :: CPython

0 commit comments

Comments
 (0)