From ab1cd445e43c737946b28bd3cf14252ed63d7dda Mon Sep 17 00:00:00 2001 From: Griatch Date: Sun, 3 Sep 2017 00:33:02 +0200 Subject: [PATCH] Further fix for multi-line non-block code at the start of batchcode file --- evennia/utils/batchprocessors.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/evennia/utils/batchprocessors.py b/evennia/utils/batchprocessors.py index 1e782ce7e5..c3a16a1575 100644 --- a/evennia/utils/batchprocessors.py +++ b/evennia/utils/batchprocessors.py @@ -354,8 +354,10 @@ class BatchCodeProcessor(object): for imatch, match in enumerate(list(_RE_CODE_OR_HEADER.finditer(text))): mtype = match.group(1).strip() # we need to handle things differently at the start of the file - mgroup = 3 if mtype else 2 - istart, iend = match.span(mgroup) + if mtype: + istart, iend = match.span(3) + else: + istart, iend = match.start(2), match.end(3) code = text[istart:iend] if mtype == "#HEADER": headers.append(code)