Skip to content

Commit db17b71

Browse files
Some last minute fixes, in particular a crash in pyobjc-core in an error case
1 parent fd84182 commit db17b71

File tree

90 files changed

+533
-4
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+533
-4
lines changed

docs/_templates/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ <h1>Introduction</h1>
1717
<tr valign="top">
1818
<td width="60%">
1919
<h1>Release information</h1>
20-
<p><b>PyObjC 9.2</b> was released on 2023-05-29. See the
20+
<p><b>PyObjC 9.2</b> was released on 2023-06-06. See the
2121
<a href="{{ pathto("changelog") }}">changelog</a> for more information.
2222
PyObjC 9 supports Python 3.7 and later.</p>
2323

docs/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ in pure Python. See our tutorial for an example of this.
1616
Release information
1717
-------------------
1818

19-
PyObjC 9.2 was released on 2023-05-29. See the :doc:`changelog <changelog>` for more information. PyObjC 9 supports Python 3.7 and later.
19+
PyObjC 9.2 was released on 2023-06-06. See the :doc:`changelog <changelog>` for more information. PyObjC 9 supports Python 3.7 and later.
2020

2121
PyObjC 8.5 is the last version supporting Python 3.6. PyObjC 5.3 is the last version supporting Python 2. These versions are
2222
no longer supported.

pyobjc-core/Modules/objc/super-call.m

+17-2
Original file line numberDiff line numberDiff line change
@@ -412,12 +412,27 @@ PyObjC_CallFunc _Nullable PyObjC_FindCallFunc(Class class, SEL sel, const char*
412412
PyObjCFFI_MakeIMPForSignature(methinfo, PyObjCSelector_GetSelector(sel), imp);
413413

414414
if (retval == NULL && PyErr_ExceptionMatches(PyExc_NotImplementedError)) {
415-
PyObject* exc = PyErr_Occurred();
415+
PyObject* exc = NULL;
416+
PyObject* tp = NULL;
417+
PyObject* traceback = NULL;
418+
419+
PyErr_Fetch(&tp, &exc, &traceback);
420+
PyErr_NormalizeException(&tp, &exc, &traceback);
421+
416422
Py_INCREF(exc);
423+
PyErr_Restore(tp, exc, traceback);
417424

418425
PyErr_Format(PyExc_NotImplementedError, "Cannot generate IMP for %s",
419426
sel_getName(aSelector));
420-
PyException_SetCause(PyErr_Occurred(), exc);
427+
428+
PyObject* new_exc = NULL;
429+
430+
PyErr_Fetch(&tp, &new_exc, &traceback);
431+
PyErr_NormalizeException(&tp, &new_exc, &traceback);
432+
Py_INCREF(new_exc);
433+
PyErr_Restore(tp, new_exc, traceback);
434+
PyException_SetCause(new_exc, exc);
435+
Py_DECREF(new_exc);
421436
}
422437

423438
return retval;

pyobjc-framework-AVFoundation/Modules/pyobjc-compat.h

+6
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,10 @@ NS_ASSUME_NONNULL_BEGIN
309309
#define MAC_OS_X_VERSION_13_4 130400
310310
#endif
311311

312+
#ifndef MAC_OS_X_VERSION_13_5
313+
#define MAC_OS_X_VERSION_13_5 130500
314+
#endif
315+
312316
/*
313317
*
314318
* End of Cocoa definitions
@@ -507,6 +511,8 @@ _PyObjCTuple_GetItem(PyObject* tuple, Py_ssize_t idx)
507511
PyGILState_Release(_GILState); \
508512
} while (0)
509513

514+
extern PyObject* _Nullable PyObjC_get_tp_dict(PyTypeObject* _Nonnull tp);
515+
510516
NS_ASSUME_NONNULL_END
511517

512518
#endif /* PyObjC_COMPAT_H */

pyobjc-framework-AVKit/Modules/pyobjc-compat.h

+6
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,10 @@ NS_ASSUME_NONNULL_BEGIN
309309
#define MAC_OS_X_VERSION_13_4 130400
310310
#endif
311311

312+
#ifndef MAC_OS_X_VERSION_13_5
313+
#define MAC_OS_X_VERSION_13_5 130500
314+
#endif
315+
312316
/*
313317
*
314318
* End of Cocoa definitions
@@ -507,6 +511,8 @@ _PyObjCTuple_GetItem(PyObject* tuple, Py_ssize_t idx)
507511
PyGILState_Release(_GILState); \
508512
} while (0)
509513

514+
extern PyObject* _Nullable PyObjC_get_tp_dict(PyTypeObject* _Nonnull tp);
515+
510516
NS_ASSUME_NONNULL_END
511517

512518
#endif /* PyObjC_COMPAT_H */

pyobjc-framework-AVRouting/Modules/pyobjc-compat.h

+6
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,10 @@ NS_ASSUME_NONNULL_BEGIN
309309
#define MAC_OS_X_VERSION_13_4 130400
310310
#endif
311311

312+
#ifndef MAC_OS_X_VERSION_13_5
313+
#define MAC_OS_X_VERSION_13_5 130500
314+
#endif
315+
312316
/*
313317
*
314318
* End of Cocoa definitions
@@ -507,6 +511,8 @@ _PyObjCTuple_GetItem(PyObject* tuple, Py_ssize_t idx)
507511
PyGILState_Release(_GILState); \
508512
} while (0)
509513

514+
extern PyObject* _Nullable PyObjC_get_tp_dict(PyTypeObject* _Nonnull tp);
515+
510516
NS_ASSUME_NONNULL_END
511517

512518
#endif /* PyObjC_COMPAT_H */

pyobjc-framework-Accessibility/Modules/pyobjc-compat.h

+6
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,10 @@ NS_ASSUME_NONNULL_BEGIN
309309
#define MAC_OS_X_VERSION_13_4 130400
310310
#endif
311311

312+
#ifndef MAC_OS_X_VERSION_13_5
313+
#define MAC_OS_X_VERSION_13_5 130500
314+
#endif
315+
312316
/*
313317
*
314318
* End of Cocoa definitions
@@ -507,6 +511,8 @@ _PyObjCTuple_GetItem(PyObject* tuple, Py_ssize_t idx)
507511
PyGILState_Release(_GILState); \
508512
} while (0)
509513

514+
extern PyObject* _Nullable PyObjC_get_tp_dict(PyTypeObject* _Nonnull tp);
515+
510516
NS_ASSUME_NONNULL_END
511517

512518
#endif /* PyObjC_COMPAT_H */

pyobjc-framework-AddressBook/Modules/pyobjc-compat.h

+6
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,10 @@ NS_ASSUME_NONNULL_BEGIN
309309
#define MAC_OS_X_VERSION_13_4 130400
310310
#endif
311311

312+
#ifndef MAC_OS_X_VERSION_13_5
313+
#define MAC_OS_X_VERSION_13_5 130500
314+
#endif
315+
312316
/*
313317
*
314318
* End of Cocoa definitions
@@ -507,6 +511,8 @@ _PyObjCTuple_GetItem(PyObject* tuple, Py_ssize_t idx)
507511
PyGILState_Release(_GILState); \
508512
} while (0)
509513

514+
extern PyObject* _Nullable PyObjC_get_tp_dict(PyTypeObject* _Nonnull tp);
515+
510516
NS_ASSUME_NONNULL_END
511517

512518
#endif /* PyObjC_COMPAT_H */

pyobjc-framework-ApplicationServices/Modules/pyobjc-compat.h

+6
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,10 @@ NS_ASSUME_NONNULL_BEGIN
309309
#define MAC_OS_X_VERSION_13_4 130400
310310
#endif
311311

312+
#ifndef MAC_OS_X_VERSION_13_5
313+
#define MAC_OS_X_VERSION_13_5 130500
314+
#endif
315+
312316
/*
313317
*
314318
* End of Cocoa definitions
@@ -507,6 +511,8 @@ _PyObjCTuple_GetItem(PyObject* tuple, Py_ssize_t idx)
507511
PyGILState_Release(_GILState); \
508512
} while (0)
509513

514+
extern PyObject* _Nullable PyObjC_get_tp_dict(PyTypeObject* _Nonnull tp);
515+
510516
NS_ASSUME_NONNULL_END
511517

512518
#endif /* PyObjC_COMPAT_H */

pyobjc-framework-AuthenticationServices/Modules/pyobjc-compat.h

+6
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,10 @@ NS_ASSUME_NONNULL_BEGIN
309309
#define MAC_OS_X_VERSION_13_4 130400
310310
#endif
311311

312+
#ifndef MAC_OS_X_VERSION_13_5
313+
#define MAC_OS_X_VERSION_13_5 130500
314+
#endif
315+
312316
/*
313317
*
314318
* End of Cocoa definitions
@@ -507,6 +511,8 @@ _PyObjCTuple_GetItem(PyObject* tuple, Py_ssize_t idx)
507511
PyGILState_Release(_GILState); \
508512
} while (0)
509513

514+
extern PyObject* _Nullable PyObjC_get_tp_dict(PyTypeObject* _Nonnull tp);
515+
510516
NS_ASSUME_NONNULL_END
511517

512518
#endif /* PyObjC_COMPAT_H */

pyobjc-framework-AutomaticAssessmentConfiguration/Modules/pyobjc-compat.h

+6
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,10 @@ NS_ASSUME_NONNULL_BEGIN
309309
#define MAC_OS_X_VERSION_13_4 130400
310310
#endif
311311

312+
#ifndef MAC_OS_X_VERSION_13_5
313+
#define MAC_OS_X_VERSION_13_5 130500
314+
#endif
315+
312316
/*
313317
*
314318
* End of Cocoa definitions
@@ -507,6 +511,8 @@ _PyObjCTuple_GetItem(PyObject* tuple, Py_ssize_t idx)
507511
PyGILState_Release(_GILState); \
508512
} while (0)
509513

514+
extern PyObject* _Nullable PyObjC_get_tp_dict(PyTypeObject* _Nonnull tp);
515+
510516
NS_ASSUME_NONNULL_END
511517

512518
#endif /* PyObjC_COMPAT_H */

pyobjc-framework-BackgroundAssets/Modules/pyobjc-compat.h

+6
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,10 @@ NS_ASSUME_NONNULL_BEGIN
309309
#define MAC_OS_X_VERSION_13_4 130400
310310
#endif
311311

312+
#ifndef MAC_OS_X_VERSION_13_5
313+
#define MAC_OS_X_VERSION_13_5 130500
314+
#endif
315+
312316
/*
313317
*
314318
* End of Cocoa definitions
@@ -507,6 +511,8 @@ _PyObjCTuple_GetItem(PyObject* tuple, Py_ssize_t idx)
507511
PyGILState_Release(_GILState); \
508512
} while (0)
509513

514+
extern PyObject* _Nullable PyObjC_get_tp_dict(PyTypeObject* _Nonnull tp);
515+
510516
NS_ASSUME_NONNULL_END
511517

512518
#endif /* PyObjC_COMPAT_H */

pyobjc-framework-CFNetwork/Modules/pyobjc-compat.h

+6
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,10 @@ NS_ASSUME_NONNULL_BEGIN
309309
#define MAC_OS_X_VERSION_13_4 130400
310310
#endif
311311

312+
#ifndef MAC_OS_X_VERSION_13_5
313+
#define MAC_OS_X_VERSION_13_5 130500
314+
#endif
315+
312316
/*
313317
*
314318
* End of Cocoa definitions
@@ -507,6 +511,8 @@ _PyObjCTuple_GetItem(PyObject* tuple, Py_ssize_t idx)
507511
PyGILState_Release(_GILState); \
508512
} while (0)
509513

514+
extern PyObject* _Nullable PyObjC_get_tp_dict(PyTypeObject* _Nonnull tp);
515+
510516
NS_ASSUME_NONNULL_END
511517

512518
#endif /* PyObjC_COMPAT_H */

pyobjc-framework-ClassKit/Modules/pyobjc-compat.h

+6
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,10 @@ NS_ASSUME_NONNULL_BEGIN
309309
#define MAC_OS_X_VERSION_13_4 130400
310310
#endif
311311

312+
#ifndef MAC_OS_X_VERSION_13_5
313+
#define MAC_OS_X_VERSION_13_5 130500
314+
#endif
315+
312316
/*
313317
*
314318
* End of Cocoa definitions
@@ -507,6 +511,8 @@ _PyObjCTuple_GetItem(PyObject* tuple, Py_ssize_t idx)
507511
PyGILState_Release(_GILState); \
508512
} while (0)
509513

514+
extern PyObject* _Nullable PyObjC_get_tp_dict(PyTypeObject* _Nonnull tp);
515+
510516
NS_ASSUME_NONNULL_END
511517

512518
#endif /* PyObjC_COMPAT_H */

pyobjc-framework-Cocoa/Lib/AppKit/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ def NSDictionaryOfVariableBindings(*names):
5858
"NSDictionaryOfVariableBindings": NSDictionaryOfVariableBindings,
5959
"__path__": __path__,
6060
"__loader__": globals().get("__loader__", None),
61+
"__file__": globals().get("__file__", None),
62+
"__spec__": globals().get("__spec__", None),
6163
},
6264
(Foundation,),
6365
)

pyobjc-framework-Cocoa/Lib/Cocoa/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
"objc": objc,
2222
"__path__": __path__,
2323
"__loader__": globals().get("__loader__", None),
24+
"__file__": globals().get("__file__", None),
25+
"__spec__": globals().get("__spec__", None),
2426
},
2527
(AppKit, Foundation),
2628
)

pyobjc-framework-Cocoa/Lib/CoreFoundation/__init__.py

+6
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
"__doc__": __doc__,
2121
"__path__": __path__,
2222
"__loader__": globals().get("__loader__", None),
23+
"__file__": globals().get("__file__", None),
24+
"__spec__": globals().get("__spec__", None),
2325
},
2426
(),
2527
)
@@ -28,11 +30,15 @@
2830
import CoreFoundation._CoreFoundation # isort:skip # noqa: E402
2931

3032
for nm in dir(CoreFoundation._CoreFoundation):
33+
if nm.startswith("_"):
34+
continue
3135
setattr(mod, nm, getattr(CoreFoundation._CoreFoundation, nm))
3236

3337
import CoreFoundation._static # isort:skip # noqa: E402
3438

3539
for nm in dir(CoreFoundation._static):
40+
if nm.startswith("_"):
41+
continue
3642
setattr(mod, nm, getattr(CoreFoundation._static, nm))
3743

3844

pyobjc-framework-Cocoa/Lib/Foundation/__init__.py

+6
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,8 @@ def indexset_contains(self, value):
178178
"NO": objc.NO,
179179
"__path__": __path__,
180180
"__loader__": globals().get("__loader__", None),
181+
"__file__": globals().get("__file__", None),
182+
"__spec__": globals().get("__spec__", None),
181183
},
182184
(CoreFoundation,),
183185
)
@@ -200,6 +202,8 @@ def indexset_contains(self, value):
200202
import Foundation._nsobject # isort:skip # noqa: E402
201203

202204
for nm in dir(Foundation._functiondefines):
205+
if nm.startswith("_"):
206+
continue
203207
setattr(mod, nm, getattr(Foundation._functiondefines, nm))
204208

205209

@@ -209,4 +213,6 @@ def indexset_contains(self, value):
209213

210214

211215
for nm in dir(Foundation._context):
216+
if nm.startswith("_"):
217+
continue
212218
setattr(mod, nm, getattr(Foundation._context, nm))

pyobjc-framework-Cocoa/Modules/pyobjc-compat.h

+6
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,10 @@ NS_ASSUME_NONNULL_BEGIN
309309
#define MAC_OS_X_VERSION_13_4 130400
310310
#endif
311311

312+
#ifndef MAC_OS_X_VERSION_13_5
313+
#define MAC_OS_X_VERSION_13_5 130500
314+
#endif
315+
312316
/*
313317
*
314318
* End of Cocoa definitions
@@ -507,6 +511,8 @@ _PyObjCTuple_GetItem(PyObject* tuple, Py_ssize_t idx)
507511
PyGILState_Release(_GILState); \
508512
} while (0)
509513

514+
extern PyObject* _Nullable PyObjC_get_tp_dict(PyTypeObject* _Nonnull tp);
515+
510516
NS_ASSUME_NONNULL_END
511517

512518
#endif /* PyObjC_COMPAT_H */

pyobjc-framework-Contacts/Modules/pyobjc-compat.h

+6
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,10 @@ NS_ASSUME_NONNULL_BEGIN
309309
#define MAC_OS_X_VERSION_13_4 130400
310310
#endif
311311

312+
#ifndef MAC_OS_X_VERSION_13_5
313+
#define MAC_OS_X_VERSION_13_5 130500
314+
#endif
315+
312316
/*
313317
*
314318
* End of Cocoa definitions
@@ -507,6 +511,8 @@ _PyObjCTuple_GetItem(PyObject* tuple, Py_ssize_t idx)
507511
PyGILState_Release(_GILState); \
508512
} while (0)
509513

514+
extern PyObject* _Nullable PyObjC_get_tp_dict(PyTypeObject* _Nonnull tp);
515+
510516
NS_ASSUME_NONNULL_END
511517

512518
#endif /* PyObjC_COMPAT_H */

pyobjc-framework-ContactsUI/Modules/pyobjc-compat.h

+6
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,10 @@ NS_ASSUME_NONNULL_BEGIN
309309
#define MAC_OS_X_VERSION_13_4 130400
310310
#endif
311311

312+
#ifndef MAC_OS_X_VERSION_13_5
313+
#define MAC_OS_X_VERSION_13_5 130500
314+
#endif
315+
312316
/*
313317
*
314318
* End of Cocoa definitions
@@ -507,6 +511,8 @@ _PyObjCTuple_GetItem(PyObject* tuple, Py_ssize_t idx)
507511
PyGILState_Release(_GILState); \
508512
} while (0)
509513

514+
extern PyObject* _Nullable PyObjC_get_tp_dict(PyTypeObject* _Nonnull tp);
515+
510516
NS_ASSUME_NONNULL_END
511517

512518
#endif /* PyObjC_COMPAT_H */

0 commit comments

Comments
 (0)