From af220b73082afac151449d56b6a19e52d59e9522 Mon Sep 17 00:00:00 2001 From: woutdenolf Date: Wed, 12 Jun 2024 00:35:15 +0200 Subject: [PATCH] keep support for python 3.6 and 3.7 --- packaging/_pyyaml_pep517.py | 8 ++++---- setup.py | 2 +- tox.ini | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packaging/_pyyaml_pep517.py b/packaging/_pyyaml_pep517.py index 5f390266..b9896393 100644 --- a/packaging/_pyyaml_pep517.py +++ b/packaging/_pyyaml_pep517.py @@ -33,7 +33,7 @@ def current(cls): def _expose_config_settings(real_method, *args, **kwargs): - from contextlib import nullcontext + from contextlib import ExitStack import inspect sig = inspect.signature(real_method) @@ -41,9 +41,9 @@ def _expose_config_settings(real_method, *args, **kwargs): config = boundargs.arguments.get('config_settings') - ctx = ActiveConfigSettings(config) if config else nullcontext() - - with ctx: + with ExitStack() as stack: + if config: + stack.enter_context(ActiveConfigSettings(config)) return real_method(*args, **kwargs) diff --git a/setup.py b/setup.py index 84bc2e46..b906c80a 100644 --- a/setup.py +++ b/setup.py @@ -270,7 +270,7 @@ def build_extensions(self): if with_ext is not None and not with_ext: continue if with_cython: - print(f"BUILDING CYTHON EXT; {self.include_dirs=} {self.library_dirs=} {self.define=}") + print(f"BUILDING CYTHON EXT; include_dirs={self.include_dirs} library_dirs={self.library_dirs} define={self.define}") ext.sources = self.cython_sources(ext.sources, ext) try: self.build_extension(ext) diff --git a/tox.ini b/tox.ini index 412d7dbc..80371120 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py38,py39,py310,py311,py312 +envlist = py36,py37,py38,py39,py310,py311,py312 [testenv] deps =