diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2020-03-01 18:17:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-01 18:17:41 +0200 |
commit | 25cbcb19a9208ebf8f5cde3f8ecb91df0a2dfebf (patch) | |
tree | cf29f0c60ac4014b9395edbe2a9c3efdad449291 /mesonbuild/optinterpreter.py | |
parent | 74452f2a1c842291c893504876507946103ac77f (diff) | |
parent | 96f661e15046a4222fd01a7216e18de901b73cb6 (diff) | |
download | meson-25cbcb19a9208ebf8f5cde3f8ecb91df0a2dfebf.zip meson-25cbcb19a9208ebf8f5cde3f8ecb91df0a2dfebf.tar.gz meson-25cbcb19a9208ebf8f5cde3f8ecb91df0a2dfebf.tar.bz2 |
Merge pull request #6627 from jon-turney/cwd-relative-file-locations
Consistently report file locations relative to cwd
Diffstat (limited to 'mesonbuild/optinterpreter.py')
-rw-r--r-- | mesonbuild/optinterpreter.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/mesonbuild/optinterpreter.py b/mesonbuild/optinterpreter.py index 1a8a04a..fd0a8c9 100644 --- a/mesonbuild/optinterpreter.py +++ b/mesonbuild/optinterpreter.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os, re +import re import functools import typing as T @@ -140,13 +140,14 @@ class OptionInterpreter: def process(self, option_file): try: with open(option_file, 'r', encoding='utf8') as f: - ast = mparser.Parser(f.read(), '').parse() + ast = mparser.Parser(f.read(), option_file).parse() except mesonlib.MesonException as me: me.file = option_file raise me if not isinstance(ast, mparser.CodeBlockNode): e = OptionException('Option file is malformed.') e.lineno = ast.lineno() + e.file = option_file raise e for cur in ast.lines: try: @@ -154,7 +155,7 @@ class OptionInterpreter: except Exception as e: e.lineno = cur.lineno e.colno = cur.colno - e.file = os.path.join('meson_options.txt') + e.file = option_file raise e def reduce_single(self, arg): |