From 19bb10c7ccfb16bfb7b8be7a34e72924d8949491 Mon Sep 17 00:00:00 2001 From: Charles Tapley Hoyt Date: Tue, 18 Nov 2025 11:38:03 +0100 Subject: [PATCH] Improve compatibility of TextIO import Motivated by https://github.com/SuLab/WikidataIntegrator/issues/206 --- pyshexc/parser/ShExDocLexer.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pyshexc/parser/ShExDocLexer.py b/pyshexc/parser/ShExDocLexer.py index 1edef1d..dbd6fc4 100644 --- a/pyshexc/parser/ShExDocLexer.py +++ b/pyshexc/parser/ShExDocLexer.py @@ -1,9 +1,11 @@ # Generated from ShExDoc.g4 by ANTLR 4.9 from antlr4 import * from io import StringIO -from typing import TextIO import sys - +if sys.version_info[1] > 5: + from typing import TextIO +else: + from typing.io import TextIO def serializedATN():