summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2016-09-17 13:40:29 +0200
committerLars-Dominik Braun <lars@6xq.net>2016-09-17 13:40:29 +0200
commit3dda7e5d32e473251b3252c5a9f357dd494905a0 (patch)
tree4316b33d1e87ad94879c48f444f0ffe6182b6400 /tools
parentfef880f42c74cc40c3faa34bd439a0f4e9f0ebd5 (diff)
downloadeumel-3dda7e5d32e473251b3252c5a9f357dd494905a0.tar.gz
eumel-3dda7e5d32e473251b3252c5a9f357dd494905a0.tar.bz2
eumel-3dda7e5d32e473251b3252c5a9f357dd494905a0.zip
formatRefs: Fix non-numeric page number handling
Diffstat (limited to 'tools')
-rwxr-xr-xtools/formatRefs.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/formatRefs.py b/tools/formatRefs.py
index 8189f2d..2cd2f9a 100755
--- a/tools/formatRefs.py
+++ b/tools/formatRefs.py
@@ -54,7 +54,10 @@ def formatParent (s, g, n, useName = True):
start = first (g.objects (n, s.pageStart))
end = first (g.objects (n, s.pageEnd))
if start:
- num = int (end)-int (start)
+ try:
+ num = int (end)-int (start)
+ except ValueError:
+ num = 1
if end and num >= 1:
ret.append ('pp. {}–{}'.format (start, end))
else: