Skip to content

Commit

Permalink
Some last minute fixes, in particular a crash in pyobjc-core in an er…
Browse files Browse the repository at this point in the history
…ror case
  • Loading branch information
ronaldoussoren committed Jun 6, 2023
1 parent fd84182 commit db17b71
Show file tree
Hide file tree
Showing 90 changed files with 533 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/_templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ <h1>Introduction</h1>
<tr valign="top">
<td width="60%">
<h1>Release information</h1>
<p><b>PyObjC 9.2</b> was released on 2023-05-29. See the
<p><b>PyObjC 9.2</b> was released on 2023-06-06. See the
<a href="{{ pathto("changelog") }}">changelog</a> for more information.
PyObjC 9 supports Python 3.7 and later.</p>

Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ in pure Python. See our tutorial for an example of this.
Release information
-------------------

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.
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.

PyObjC 8.5 is the last version supporting Python 3.6. PyObjC 5.3 is the last version supporting Python 2. These versions are
no longer supported.
Expand Down
19 changes: 17 additions & 2 deletions pyobjc-core/Modules/objc/super-call.m
Original file line number Diff line number Diff line change
Expand Up @@ -412,12 +412,27 @@ PyObjC_CallFunc _Nullable PyObjC_FindCallFunc(Class class, SEL sel, const char*
PyObjCFFI_MakeIMPForSignature(methinfo, PyObjCSelector_GetSelector(sel), imp);

if (retval == NULL && PyErr_ExceptionMatches(PyExc_NotImplementedError)) {
PyObject* exc = PyErr_Occurred();
PyObject* exc = NULL;
PyObject* tp = NULL;
PyObject* traceback = NULL;

PyErr_Fetch(&tp, &exc, &traceback);
PyErr_NormalizeException(&tp, &exc, &traceback);

Py_INCREF(exc);
PyErr_Restore(tp, exc, traceback);

PyErr_Format(PyExc_NotImplementedError, "Cannot generate IMP for %s",
sel_getName(aSelector));
PyException_SetCause(PyErr_Occurred(), exc);

PyObject* new_exc = NULL;

PyErr_Fetch(&tp, &new_exc, &traceback);
PyErr_NormalizeException(&tp, &new_exc, &traceback);
Py_INCREF(new_exc);
PyErr_Restore(tp, new_exc, traceback);
PyException_SetCause(new_exc, exc);
Py_DECREF(new_exc);
}

return retval;
Expand Down
6 changes: 6 additions & 0 deletions pyobjc-framework-AVFoundation/Modules/pyobjc-compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,10 @@ NS_ASSUME_NONNULL_BEGIN
#define MAC_OS_X_VERSION_13_4 130400
#endif

#ifndef MAC_OS_X_VERSION_13_5
#define MAC_OS_X_VERSION_13_5 130500
#endif

/*
*
* End of Cocoa definitions
Expand Down Expand Up @@ -507,6 +511,8 @@ _PyObjCTuple_GetItem(PyObject* tuple, Py_ssize_t idx)
PyGILState_Release(_GILState); \
} while (0)

extern PyObject* _Nullable PyObjC_get_tp_dict(PyTypeObject* _Nonnull tp);

NS_ASSUME_NONNULL_END

#endif /* PyObjC_COMPAT_H */
6 changes: 6 additions & 0 deletions pyobjc-framework-AVKit/Modules/pyobjc-compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,10 @@ NS_ASSUME_NONNULL_BEGIN
#define MAC_OS_X_VERSION_13_4 130400
#endif

#ifndef MAC_OS_X_VERSION_13_5
#define MAC_OS_X_VERSION_13_5 130500
#endif

/*
*
* End of Cocoa definitions
Expand Down Expand Up @@ -507,6 +511,8 @@ _PyObjCTuple_GetItem(PyObject* tuple, Py_ssize_t idx)
PyGILState_Release(_GILState); \
} while (0)

extern PyObject* _Nullable PyObjC_get_tp_dict(PyTypeObject* _Nonnull tp);

NS_ASSUME_NONNULL_END

#endif /* PyObjC_COMPAT_H */
6 changes: 6 additions & 0 deletions pyobjc-framework-AVRouting/Modules/pyobjc-compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,10 @@ NS_ASSUME_NONNULL_BEGIN
#define MAC_OS_X_VERSION_13_4 130400
#endif

#ifndef MAC_OS_X_VERSION_13_5
#define MAC_OS_X_VERSION_13_5 130500
#endif

/*
*
* End of Cocoa definitions
Expand Down Expand Up @@ -507,6 +511,8 @@ _PyObjCTuple_GetItem(PyObject* tuple, Py_ssize_t idx)
PyGILState_Release(_GILState); \
} while (0)

extern PyObject* _Nullable PyObjC_get_tp_dict(PyTypeObject* _Nonnull tp);

NS_ASSUME_NONNULL_END

#endif /* PyObjC_COMPAT_H */
6 changes: 6 additions & 0 deletions pyobjc-framework-Accessibility/Modules/pyobjc-compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,10 @@ NS_ASSUME_NONNULL_BEGIN
#define MAC_OS_X_VERSION_13_4 130400
#endif

#ifndef MAC_OS_X_VERSION_13_5
#define MAC_OS_X_VERSION_13_5 130500
#endif

/*
*
* End of Cocoa definitions
Expand Down Expand Up @@ -507,6 +511,8 @@ _PyObjCTuple_GetItem(PyObject* tuple, Py_ssize_t idx)
PyGILState_Release(_GILState); \
} while (0)

extern PyObject* _Nullable PyObjC_get_tp_dict(PyTypeObject* _Nonnull tp);

NS_ASSUME_NONNULL_END

#endif /* PyObjC_COMPAT_H */
6 changes: 6 additions & 0 deletions pyobjc-framework-AddressBook/Modules/pyobjc-compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,10 @@ NS_ASSUME_NONNULL_BEGIN
#define MAC_OS_X_VERSION_13_4 130400
#endif

#ifndef MAC_OS_X_VERSION_13_5
#define MAC_OS_X_VERSION_13_5 130500
#endif

/*
*
* End of Cocoa definitions
Expand Down Expand Up @@ -507,6 +511,8 @@ _PyObjCTuple_GetItem(PyObject* tuple, Py_ssize_t idx)
PyGILState_Release(_GILState); \
} while (0)

extern PyObject* _Nullable PyObjC_get_tp_dict(PyTypeObject* _Nonnull tp);

NS_ASSUME_NONNULL_END

#endif /* PyObjC_COMPAT_H */
6 changes: 6 additions & 0 deletions pyobjc-framework-ApplicationServices/Modules/pyobjc-compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,10 @@ NS_ASSUME_NONNULL_BEGIN
#define MAC_OS_X_VERSION_13_4 130400
#endif

#ifndef MAC_OS_X_VERSION_13_5
#define MAC_OS_X_VERSION_13_5 130500
#endif

/*
*
* End of Cocoa definitions
Expand Down Expand Up @@ -507,6 +511,8 @@ _PyObjCTuple_GetItem(PyObject* tuple, Py_ssize_t idx)
PyGILState_Release(_GILState); \
} while (0)

extern PyObject* _Nullable PyObjC_get_tp_dict(PyTypeObject* _Nonnull tp);

NS_ASSUME_NONNULL_END

#endif /* PyObjC_COMPAT_H */
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,10 @@ NS_ASSUME_NONNULL_BEGIN
#define MAC_OS_X_VERSION_13_4 130400
#endif

#ifndef MAC_OS_X_VERSION_13_5
#define MAC_OS_X_VERSION_13_5 130500
#endif

/*
*
* End of Cocoa definitions
Expand Down Expand Up @@ -507,6 +511,8 @@ _PyObjCTuple_GetItem(PyObject* tuple, Py_ssize_t idx)
PyGILState_Release(_GILState); \
} while (0)

extern PyObject* _Nullable PyObjC_get_tp_dict(PyTypeObject* _Nonnull tp);

NS_ASSUME_NONNULL_END

#endif /* PyObjC_COMPAT_H */
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,10 @@ NS_ASSUME_NONNULL_BEGIN
#define MAC_OS_X_VERSION_13_4 130400
#endif

#ifndef MAC_OS_X_VERSION_13_5
#define MAC_OS_X_VERSION_13_5 130500
#endif

/*
*
* End of Cocoa definitions
Expand Down Expand Up @@ -507,6 +511,8 @@ _PyObjCTuple_GetItem(PyObject* tuple, Py_ssize_t idx)
PyGILState_Release(_GILState); \
} while (0)

extern PyObject* _Nullable PyObjC_get_tp_dict(PyTypeObject* _Nonnull tp);

NS_ASSUME_NONNULL_END

#endif /* PyObjC_COMPAT_H */
6 changes: 6 additions & 0 deletions pyobjc-framework-BackgroundAssets/Modules/pyobjc-compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,10 @@ NS_ASSUME_NONNULL_BEGIN
#define MAC_OS_X_VERSION_13_4 130400
#endif

#ifndef MAC_OS_X_VERSION_13_5
#define MAC_OS_X_VERSION_13_5 130500
#endif

/*
*
* End of Cocoa definitions
Expand Down Expand Up @@ -507,6 +511,8 @@ _PyObjCTuple_GetItem(PyObject* tuple, Py_ssize_t idx)
PyGILState_Release(_GILState); \
} while (0)

extern PyObject* _Nullable PyObjC_get_tp_dict(PyTypeObject* _Nonnull tp);

NS_ASSUME_NONNULL_END

#endif /* PyObjC_COMPAT_H */
6 changes: 6 additions & 0 deletions pyobjc-framework-CFNetwork/Modules/pyobjc-compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,10 @@ NS_ASSUME_NONNULL_BEGIN
#define MAC_OS_X_VERSION_13_4 130400
#endif

#ifndef MAC_OS_X_VERSION_13_5
#define MAC_OS_X_VERSION_13_5 130500
#endif

/*
*
* End of Cocoa definitions
Expand Down Expand Up @@ -507,6 +511,8 @@ _PyObjCTuple_GetItem(PyObject* tuple, Py_ssize_t idx)
PyGILState_Release(_GILState); \
} while (0)

extern PyObject* _Nullable PyObjC_get_tp_dict(PyTypeObject* _Nonnull tp);

NS_ASSUME_NONNULL_END

#endif /* PyObjC_COMPAT_H */
6 changes: 6 additions & 0 deletions pyobjc-framework-ClassKit/Modules/pyobjc-compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,10 @@ NS_ASSUME_NONNULL_BEGIN
#define MAC_OS_X_VERSION_13_4 130400
#endif

#ifndef MAC_OS_X_VERSION_13_5
#define MAC_OS_X_VERSION_13_5 130500
#endif

/*
*
* End of Cocoa definitions
Expand Down Expand Up @@ -507,6 +511,8 @@ _PyObjCTuple_GetItem(PyObject* tuple, Py_ssize_t idx)
PyGILState_Release(_GILState); \
} while (0)

extern PyObject* _Nullable PyObjC_get_tp_dict(PyTypeObject* _Nonnull tp);

NS_ASSUME_NONNULL_END

#endif /* PyObjC_COMPAT_H */
2 changes: 2 additions & 0 deletions pyobjc-framework-Cocoa/Lib/AppKit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ def NSDictionaryOfVariableBindings(*names):
"NSDictionaryOfVariableBindings": NSDictionaryOfVariableBindings,
"__path__": __path__,
"__loader__": globals().get("__loader__", None),
"__file__": globals().get("__file__", None),
"__spec__": globals().get("__spec__", None),
},
(Foundation,),
)
Expand Down
2 changes: 2 additions & 0 deletions pyobjc-framework-Cocoa/Lib/Cocoa/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
"objc": objc,
"__path__": __path__,
"__loader__": globals().get("__loader__", None),
"__file__": globals().get("__file__", None),
"__spec__": globals().get("__spec__", None),
},
(AppKit, Foundation),
)
Expand Down
6 changes: 6 additions & 0 deletions pyobjc-framework-Cocoa/Lib/CoreFoundation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
"__doc__": __doc__,
"__path__": __path__,
"__loader__": globals().get("__loader__", None),
"__file__": globals().get("__file__", None),
"__spec__": globals().get("__spec__", None),
},
(),
)
Expand All @@ -28,11 +30,15 @@
import CoreFoundation._CoreFoundation # isort:skip # noqa: E402

for nm in dir(CoreFoundation._CoreFoundation):
if nm.startswith("_"):
continue
setattr(mod, nm, getattr(CoreFoundation._CoreFoundation, nm))

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

for nm in dir(CoreFoundation._static):
if nm.startswith("_"):
continue
setattr(mod, nm, getattr(CoreFoundation._static, nm))


Expand Down
6 changes: 6 additions & 0 deletions pyobjc-framework-Cocoa/Lib/Foundation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ def indexset_contains(self, value):
"NO": objc.NO,
"__path__": __path__,
"__loader__": globals().get("__loader__", None),
"__file__": globals().get("__file__", None),
"__spec__": globals().get("__spec__", None),
},
(CoreFoundation,),
)
Expand All @@ -200,6 +202,8 @@ def indexset_contains(self, value):
import Foundation._nsobject # isort:skip # noqa: E402

for nm in dir(Foundation._functiondefines):
if nm.startswith("_"):
continue
setattr(mod, nm, getattr(Foundation._functiondefines, nm))


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


for nm in dir(Foundation._context):
if nm.startswith("_"):
continue
setattr(mod, nm, getattr(Foundation._context, nm))
6 changes: 6 additions & 0 deletions pyobjc-framework-Cocoa/Modules/pyobjc-compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,10 @@ NS_ASSUME_NONNULL_BEGIN
#define MAC_OS_X_VERSION_13_4 130400
#endif

#ifndef MAC_OS_X_VERSION_13_5
#define MAC_OS_X_VERSION_13_5 130500
#endif

/*
*
* End of Cocoa definitions
Expand Down Expand Up @@ -507,6 +511,8 @@ _PyObjCTuple_GetItem(PyObject* tuple, Py_ssize_t idx)
PyGILState_Release(_GILState); \
} while (0)

extern PyObject* _Nullable PyObjC_get_tp_dict(PyTypeObject* _Nonnull tp);

NS_ASSUME_NONNULL_END

#endif /* PyObjC_COMPAT_H */
6 changes: 6 additions & 0 deletions pyobjc-framework-Contacts/Modules/pyobjc-compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,10 @@ NS_ASSUME_NONNULL_BEGIN
#define MAC_OS_X_VERSION_13_4 130400
#endif

#ifndef MAC_OS_X_VERSION_13_5
#define MAC_OS_X_VERSION_13_5 130500
#endif

/*
*
* End of Cocoa definitions
Expand Down Expand Up @@ -507,6 +511,8 @@ _PyObjCTuple_GetItem(PyObject* tuple, Py_ssize_t idx)
PyGILState_Release(_GILState); \
} while (0)

extern PyObject* _Nullable PyObjC_get_tp_dict(PyTypeObject* _Nonnull tp);

NS_ASSUME_NONNULL_END

#endif /* PyObjC_COMPAT_H */
6 changes: 6 additions & 0 deletions pyobjc-framework-ContactsUI/Modules/pyobjc-compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,10 @@ NS_ASSUME_NONNULL_BEGIN
#define MAC_OS_X_VERSION_13_4 130400
#endif

#ifndef MAC_OS_X_VERSION_13_5
#define MAC_OS_X_VERSION_13_5 130500
#endif

/*
*
* End of Cocoa definitions
Expand Down Expand Up @@ -507,6 +511,8 @@ _PyObjCTuple_GetItem(PyObject* tuple, Py_ssize_t idx)
PyGILState_Release(_GILState); \
} while (0)

extern PyObject* _Nullable PyObjC_get_tp_dict(PyTypeObject* _Nonnull tp);

NS_ASSUME_NONNULL_END

#endif /* PyObjC_COMPAT_H */
Loading

0 comments on commit db17b71

Please sign in to comment.