Use importlib instead of imp module on python 3.4+
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.
This commit is contained in:
parent
74edb473c9
commit
bfb9f5dcfe
@ -1,3 +1,8 @@
|
||||
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.
|
||||
|
@ -18,8 +18,10 @@ import os
|
||||
import sys
|
||||
import _gdb
|
||||
|
||||
if sys.version_info[0] > 2:
|
||||
# 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 *
|
||||
|
Loading…
Reference in New Issue
Block a user