Commit 4a1aa23
committed
PYCBC-1828: Propagate OOM failures from init_pycbc_dict_keys
Changes
--------
* Change init_pycbc_dict_keys to return int, checking each of the
~130 interned dict-key globals and returning -1 on the first
PyUnicode_FromString failure instead of leaving the global
permanently null with no signal to the caller
* Update the pycbc_dict_keys.hxx/.cxx Jinja2 templates to match, and
regenerate the bindings so the checked-in output stays in sync
* Check init_pycbc_dict_keys's return value in PyInit__core, failing
module init cleanly (Py_DECREF(module); return nullptr) on the same
pattern already used for cache_exception_classes and the other
init steps, instead of silently continuing with null interned keys
Change-Id: I2919a3dbada81e6e79de1584eed7ce4f38b9aadf
Reviewed-on: https://review.couchbase.org/c/couchbase-python-client/+/250070
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>1 parent d29be2f commit 4a1aa23
5 files changed
Lines changed: 379 additions & 9 deletions
File tree
- src
- tools/autogen/templates/bindings
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
183 | | - | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
184 | 187 | | |
185 | 188 | | |
186 | 189 | | |
0 commit comments