On 20 Apr 2020, at 17:57, William Tu wrote:

On Mon, Apr 20, 2020 at 03:37:03PM +0200, Eelco Chaudron wrote:
William,

Can you try adding this somewhere at the top after the other import section?

from __future__ import print_function

And let me know if it works?

Thanks,

Eelco

Hi Eelco,

Thanks, it work, but I have to put it "before" other import

diff --git a/utilities/gdb/ovs_gdb.py b/utilities/gdb/ovs_gdb.py
index befc2b4a4b45..3a23df452816 100644
--- a/utilities/gdb/ovs_gdb.py
+++ b/utilities/gdb/ovs_gdb.py
@@ -55,11 +55,14 @@
 #    ...
 #    ...
 #
+
+from __future__ import print_function
 import gdb
 import sys
 import uuid


Putting it after import below has the issue

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
0x00007f57c81f774d in poll () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) source utilities/gdb/ovs_gdb.py
  File "utilities/gdb/ovs_gdb.py", line 62
    from __future__ import print_function
SyntaxError: from __future__ imports must occur at the beginning of the file
(gdb)


Yes the __future__ should be at the top, thanks for testing. I did some more testing on older and newer versions of Python and sent out a patch.

Cheers,

Eelco

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to