Count the line outside the f-string so Python 3.11 still parses the script
This commit is contained in:
+2
-1
@@ -166,7 +166,8 @@ def read_premises(root):
|
||||
except OSError as failure:
|
||||
sys.exit(f"README.md in {root}: {failure.strerror} - no premises.")
|
||||
except UnicodeDecodeError as failure:
|
||||
sys.exit(f"README.md is not UTF-8 on line {failure.object[:failure.start].count(b'\n') + 1} - no premises.")
|
||||
line = failure.object.count(b"\n", 0, failure.start) + 1
|
||||
sys.exit(f"README.md is not UTF-8 on line {line} - no premises.")
|
||||
for name in ("Goals", "Audience"):
|
||||
bodies = found.get(name, [])
|
||||
if not bodies:
|
||||
|
||||
Reference in New Issue
Block a user