diff options
author | Kenpachi2k13 <3476227+Kenpachi2k13@users.noreply.github.com> | 2020-05-03 09:14:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-03 09:14:56 +0200 |
commit | cd593de68b02d77766fcb3b7b2a869096ceb7183 (patch) | |
tree | 2245738ce70d50031b927fed560815458658c7c2 /tools/utils/libconf.py | |
parent | f70a887b188dbd88c45c9992cd18a33b6886005f (diff) | |
parent | f40cc839413cc82aed445d39cc3aa204dce87780 (diff) | |
download | hercules-cd593de68b02d77766fcb3b7b2a869096ceb7183.tar.gz hercules-cd593de68b02d77766fcb3b7b2a869096ceb7183.tar.bz2 hercules-cd593de68b02d77766fcb3b7b2a869096ceb7183.tar.xz hercules-cd593de68b02d77766fcb3b7b2a869096ceb7183.zip |
Merge branch 'master' into cell_noskill
Diffstat (limited to 'tools/utils/libconf.py')
-rw-r--r-- | tools/utils/libconf.py | 13 |
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 |