summaryrefslogtreecommitdiff
path: root/tools/utils/libconf.py
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2021-01-07 17:33:07 -0300
committerJesusaves <cpntb1@ymail.com>2021-01-07 17:33:07 -0300
commit662279e8b2cb79a03864f84fdf799f0489fdfc7b (patch)
treee7104bc31f901d16c8597cae26aa31ccb20364ab /tools/utils/libconf.py
parent174d11705a13bd780dbb5c908f786fc65a6c2f9c (diff)
downloadhercules-662279e8b2cb79a03864f84fdf799f0489fdfc7b.tar.gz
hercules-662279e8b2cb79a03864f84fdf799f0489fdfc7b.tar.bz2
hercules-662279e8b2cb79a03864f84fdf799f0489fdfc7b.tar.xz
hercules-662279e8b2cb79a03864f84fdf799f0489fdfc7b.zip
Partial upgrade to v2020.01.12
Diffstat (limited to 'tools/utils/libconf.py')
-rw-r--r--tools/utils/libconf.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/tools/utils/libconf.py b/tools/utils/libconf.py
index 635efd07d..3858b93b5 100644
--- a/tools/utils/libconf.py
+++ b/tools/utils/libconf.py
@@ -1,7 +1,7 @@
#!/usr/bin/python
# -*- coding: utf8 -*-
#
-# Copyright (C) 2018 Hercules Dev Team
+# Copyright (C) 2018-2020 Hercules Dev Team
#
# This library is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -226,8 +226,15 @@ class Tokenizer:
for cls, type, regex in self.token_map:
m = regex.match(string, pos=pos)
if m:
- yield cls(type, m.group(0),
- self.filename, self.row, self.column)
+ try:
+ yield cls(type, m.group(0),
+ self.filename, self.row, self.column)
+ except ValueError as e:
+ print("Error parsing file "
+ "{0}, in line:\n{1}\n{2}".format(self.filename,
+ m.group(0),
+ self.row))
+ raise
self.column += len(m.group(0))
pos = m.end()
break