Commit c9e9b267 authored by Julien Muchembled's avatar Julien Muchembled

Conditional configuration sections: expose new 'multiarch' value in sys

To be dropped once all buildout in the wild are able to upgrade to a
version that supports new names in expression of conditional sections
(see previous commit).
parent 1b3a3e1e
Pipeline #19075 passed with stage
in 0 seconds
......@@ -1872,6 +1872,7 @@ class _default_globals(dict):
context = self.context
except AttributeError:
context = self.context = cls._default_globals()
context['sys'] = _sysproxy(self)
try:
return context[key]
except KeyError as e:
......@@ -1891,6 +1892,18 @@ class _default_globals(dict):
del self['__doing__']
return m
class _sysproxy(object): # BBB: alternate/temporary way to get multiarch value
def __init__(self, default_globals):
self.__default_globals = default_globals
def __getattr__(self, name):
if name == '_multiarch':
default_globals = self.__default_globals
setattr(sys, name, getattr(default_globals, name[1:])())
default_globals.context['sys'] = sys
return getattr(sys, name)
def _open(base, filename, dl_options, override, seen=None, processing=None):
"""Open a configuration file and return the result as a dictionary,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment