aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/python/lib/gdb/__init__.py6
2 files changed, 9 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 9684f29..ac40f8e 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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.
diff --git a/gdb/python/lib/gdb/__init__.py b/gdb/python/lib/gdb/__init__.py
index 84ec728..9a0e989 100644
--- a/gdb/python/lib/gdb/__init__.py
+++ b/gdb/python/lib/gdb/__init__.py
@@ -18,8 +18,10 @@ import os
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 *