This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch, libstdc++] Use explicit relative imports for the pretty printers

When gdb is linked/used with Python 3, import of the pretty printers fails:

Traceback (most recent call last):
line 58, in <module>
   import libstdcxx.v6
line 19, in <module>
   from printers import register_libstdcxx_printers
ImportError: No module named 'printers'
[Inferior 1 (process 6130) exited normally]

Python3 doesn't support implicit relative imports anymore.  Use explicit
relative imports instead.  This syntax is compatible with Python 2.5 and newer
2.x versions.  Ok for the trunk?


2015-02-25  Matthias Klose  <>

	* python/libstdcxx/v6/ Use explicit relative imports.

Index: libstdc++-v3/python/libstdcxx/v6/
--- libstdc++-v3/python/libstdcxx/v6/	(revision 220970)
+++ libstdc++-v3/python/libstdcxx/v6/	(working copy)
@@ -16,7 +16,7 @@
 import gdb

 # Load the pretty-printers.
-from printers import register_libstdcxx_printers
+from .printers import register_libstdcxx_printers

 # Load the xmethods if GDB supports them.
@@ -28,5 +28,5 @@
         return False

 if gdb_has_xmethods():
-    from xmethods import register_libstdcxx_xmethods
+    from .xmethods import register_libstdcxx_xmethods

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]