Message120462
Better bsddb error control. Please, review.
"""
[jcea@babylon5 release27-maint]$ ./python
Python 2.7.0+ (release27-maint:86176:86178M, Nov 5 2010, 00:30:)
[GCC 4.5.1] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> import bsddb
>>> exit()
"""
"""
[jcea@babylon5 release27-maint]$ ./python -3
Python 2.7.0+ (release27-maint:86176:86178M, Nov 5 2010, 00:30:)
[GCC 4.5.1] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> import bsddb
__main__:1: DeprecationWarning: in 3.x, the bsddb module has been removed; please use the pybsddb project instead
/home/python/svn-hg/release27-maint/Lib/bsddb/__init__.py:67: DeprecationWarning: CObject type is not supported in 3.x. Please use capsule objects instead.
import _bsddb
"""
"""
[jcea@babylon5 release27-maint]$ ./python -3 -Werror
Python 2.7.0+ (release27-maint:86176:86178M, Nov 5 2010, 00:30:)
[GCC 4.5.1] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> import warnings
>>> warnings.filterwarnings('ignore',
... "in 3.x, the bsddb module has been removed; please use the pybsddb project instead",
... category=DeprecationWarning)
>>> import bsddb
Exception DeprecationWarning: DeprecationWarning('CObject type is not supported in 3.x. Please use capsule objects instead.',) in <module '_bsddb' (built-in)> ignored
>>> exit()
"""
Why is my "PyErr_Warn()" not being printed?
The code: (py_api is the CObject, will be NULL if an exception happened)
"""
if (py_api) {
PyDict_SetItemString(d, "api", py_api);
Py_DECREF(py_api);
} else { /* Something bad happened */
PyErr_WriteUnraisable(m);
PyErr_Warn(PyExc_RuntimeWarning,
"_bsddb/_pybsddb C API will be not available");
PyErr_Clear();
}
"""
Commit r86180.
Now I have to up-port this patch to the upcoming pybssddb 5.1.1. |
|
Date |
User |
Action |
Args |
2010-11-05 00:16:06 | jcea | set | recipients:
+ jcea, flox, dmalcolm |
2010-11-05 00:16:06 | jcea | set | messageid: <1288916166.59.0.557225304287.issue9675@psf.upfronthosting.co.za> |
2010-11-05 00:16:05 | jcea | link | issue9675 messages |
2010-11-05 00:16:04 | jcea | create | |
|