Skip to content

Commit 36c2d98

Browse files
committed
Debug in prod
1 parent 3f00019 commit 36c2d98

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

BlmapChill/print_version.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
# expected sample output: 184
1010
#
1111

12+
from os.path import isfile
1213
import sys
1314

1415
import twmap
@@ -17,7 +18,11 @@
1718
print(f"usage: {sys.argv[0]} map")
1819
sys.exit(0)
1920

20-
m = twmap.Map(sys.argv[1])
21+
map_path = sys.argv[1]
22+
if not isfile(map_path):
23+
print(f"Mapfile not found '{map_path}'", file=sys.stderr)
24+
exit(1)
25+
m = twmap.Map(map_path)
2126

2227
# TXT+Deep (version number text)
2328
txt_tiles = m.groups[17].layers[5].tiles

0 commit comments

Comments
 (0)