aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2017-07-01 00:11:27 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2017-07-01 00:11:27 +0300
commitc11a4cb952835afda6161f6d63e1eded4381d5a0 (patch)
treecaa2c549524f37e09f7b20e780fdd23d12fdd251
parentc0ab6e9d5b9cb5e98d3d17eca42b9d596b873b0a (diff)
downloadmeson-c11a4cb952835afda6161f6d63e1eded4381d5a0.zip
meson-c11a4cb952835afda6161f6d63e1eded4381d5a0.tar.gz
meson-c11a4cb952835afda6161f6d63e1eded4381d5a0.tar.bz2
Make Interpreter object unpicklable as it was being pickled by accident in copies of kwargs.
-rw-r--r--mesonbuild/interpreter.py1
-rw-r--r--mesonbuild/interpreterbase.py1
-rw-r--r--mesonbuild/mesonlib.py5
3 files changed, 7 insertions, 0 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
index 13c3119..d776b05 100644
--- a/mesonbuild/interpreter.py
+++ b/mesonbuild/interpreter.py
@@ -1308,6 +1308,7 @@ class Interpreter(InterpreterBase):
def __init__(self, build, backend, subproject='', subdir='', subproject_dir='subprojects',
default_project_options=[]):
super().__init__(build.environment.get_source_dir(), subdir)
+ self.an_unpicklable_object = mesonlib.an_unpicklable_object
self.build = build
self.environment = build.environment
self.coredata = self.environment.get_coredata()
diff --git a/mesonbuild/interpreterbase.py b/mesonbuild/interpreterbase.py
index d44f71b..7e9fa26 100644
--- a/mesonbuild/interpreterbase.py
+++ b/mesonbuild/interpreterbase.py
@@ -61,6 +61,7 @@ class permittedKwargs:
self.permitted = permitted
def __call__(self, f):
+ @wraps(f)
def wrapped(s, node, args, kwargs):
for k in kwargs:
if k not in self.permitted:
diff --git a/mesonbuild/mesonlib.py b/mesonbuild/mesonlib.py
index 415bc50..bf6ba98 100644
--- a/mesonbuild/mesonlib.py
+++ b/mesonbuild/mesonlib.py
@@ -21,6 +21,11 @@ import collections
from glob import glob
+# Put this in objects that should not get dumped to pickle files
+# by accident.
+import threading
+an_unpicklable_object = threading.Lock()
+
class MesonException(Exception):
'''Exceptions thrown by Meson'''