From 3dda7e5d32e473251b3252c5a9f357dd494905a0 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Sat, 17 Sep 2016 13:40:29 +0200 Subject: formatRefs: Fix non-numeric page number handling --- tools/formatRefs.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tools') 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: -- cgit v1.2.3