[PATCH 22 of 23 yams] [fix] invalid code in python3

Laurent Peuch cortex at worlddomination.be
Fri Feb 14 16:00:12 CET 2020


# HG changeset patch
# User Laurent Peuch <cortex at worlddomination.be>
# Date 1580318343 -3600
#      Wed Jan 29 18:19:03 2020 +0100
# Node ID ea78e7eafae213f79a0c5f19b90ece48fe1933f5
# Parent  ee5177e419541f8ba13ec76b4f4e1a8a8ac15f7a
# Available At https://hg.logilab.org/users/lpeuch/yams
#              hg pull https://hg.logilab.org/users/lpeuch/yams -r ea78e7eafae2
[fix] invalid code in python3

diff --git a/yams/tools.py b/yams/tools.py
--- a/yams/tools.py
+++ b/yams/tools.py
@@ -50,7 +50,8 @@ def check_schema() -> int:
         return 0
     except Exception as ex:
         tb_offset = getattr(ex, 'tb_offset', 0)
-        filename, lineno, _, _ = extract_tb(sys.exc_traceback)[-1 - tb_offset]
+        _, _, traceback = sys.exc_info()
+        filename, lineno, _, _ = extract_tb(traceback)[-1 - tb_offset]
 
         if hasattr(ex, "schema_files"):
             filename = ', '.join(ex.schema_files)  # type: ignore



More information about the cubicweb-devel mailing list