[PATCH 22 of 24 yams V2] [fix] invalid code in python3

Laurent Peuch cortex at worlddomination.be
Wed Mar 4 15:17:58 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 32c9c906e3aa867eab3bd9c529c1ea45b29af909
# Parent  a27d8e2f0f45a0521afc1eb48c1b471b9fe99839
# Available At https://hg.logilab.org/users/lpeuch/yams
#              hg pull https://hg.logilab.org/users/lpeuch/yams -r 32c9c906e3aa
# EXP-Topic type_annotations
[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"):
             # mypy: "Exception" has no attribute "schema_files"



More information about the cubicweb-devel mailing list