Python 3.4 has deprecated the imp module in favour of importlib. This
patch avoids the DeprecationWarning. This warning is visible to users
whose libpython.so has been compiled with --with-pydebug.
Considering that even python 3.5 has reached end of life, would it be
better to just use importlib and drop support for python 3.0 to 3.3?
2021-02-28 Boris Staletic <boris.staletic@gmail.com>
* gdb/python/lib/gdb/__init__.py: Use importlib on python 3.4+
to avoid deprecation warnings.
+2021-02-28 Boris Staletic <boris.staletic@gmail.com>
+
+ * gdb/python/lib/gdb/__init__.py: Use importlib on python 3.4+
+ to avoid deprecation warnings.
+
2021-04-01 Martin Liska <mliska@suse.cz>
* cp-name-parser.y: Use startswith instead of strncmp.
import sys
import _gdb
-if sys.version_info[0] > 2:
- # Python 3 moved "reload"
+# Python 3 moved "reload"
+if sys.version_info >= (3, 4):
+ from importlib import reload
+elif sys.version_info[0] > 2:
from imp import reload
from _gdb import *