Make Interpreter object unpicklable as it was being pickled by accident in copies of kwargs.

pull/2017/head
Jussi Pakkanen 8 years ago
parent c0ab6e9d5b
commit c11a4cb952
  1. 1
      mesonbuild/interpreter.py
  2. 1
      mesonbuild/interpreterbase.py
  3. 5
      mesonbuild/mesonlib.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()

@ -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:

@ -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'''

Loading…
Cancel
Save