diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2020-09-08 10:20:28 -0400 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2020-09-10 11:39:30 -0400 |
commit | 8a9baab4d3ac402645e719fb6e9180383ac5d3e8 (patch) | |
tree | dd2dcdebf1a4c338df72715429b97dae34c56b08 /mesonbuild/mesonlib.py | |
parent | 1101144d864ee6c13b259c5f9a0f9189a87111d3 (diff) | |
download | meson-8a9baab4d3ac402645e719fb6e9180383ac5d3e8.zip meson-8a9baab4d3ac402645e719fb6e9180383ac5d3e8.tar.gz meson-8a9baab4d3ac402645e719fb6e9180383ac5d3e8.tar.bz2 |
mesonlib: Move MesonException declaration to the top
Diffstat (limited to 'mesonbuild/mesonlib.py')
-rw-r--r-- | mesonbuild/mesonlib.py | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/mesonbuild/mesonlib.py b/mesonbuild/mesonlib.py index f649738..cf43131 100644 --- a/mesonbuild/mesonlib.py +++ b/mesonbuild/mesonlib.py @@ -65,6 +65,17 @@ else: python_command = [sys.executable] meson_command = None +class MesonException(Exception): + '''Exceptions thrown by Meson''' + + file = None # type: T.Optional[str] + lineno = None # type: T.Optional[int] + colno = None # type: T.Optional[int] + + +class EnvironmentException(MesonException): + '''Exceptions thrown while processing and creating the build environment''' + GIT = shutil.which('git') def git(cmd: T.List[str], workingdir: str, **kwargs: T.Any) -> subprocess.CompletedProcess: pc = subprocess.run([GIT, '-C', workingdir] + cmd, @@ -132,19 +143,6 @@ def check_direntry_issues(direntry_array: T.Union[T.List[T.Union[str, bytes]], s import threading an_unpicklable_object = threading.Lock() - -class MesonException(Exception): - '''Exceptions thrown by Meson''' - - file = None # type: T.Optional[str] - lineno = None # type: T.Optional[int] - colno = None # type: T.Optional[int] - - -class EnvironmentException(MesonException): - '''Exceptions thrown while processing and creating the build environment''' - - class FileMode: # The first triad is for owner permissions, the second for group permissions, # and the third for others (everyone else). |