File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
src/tox/tox_env/python/virtual_env/package Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -118,15 +118,14 @@ def root(self) -> Path:
118118
119119 @root .setter
120120 def root (self , value : Path ) -> None :
121- # NOTE(vytas): Recreating the frontend with a new root will orphan the
122- # current frontend.backend_executor, if any, making tox hang upon
123- # exit waiting for its threads and subprocesses (#3512).
124- #
125- # Here, we partially work around the issue by only resetting the root
126- # when it has actually changed:
127- if self ._root != value :
128- self ._root = value
129- self ._frontend_ = None # force recreating the frontend with new root
121+ # Recreating the frontend with a new root would orphan the current frontend.backend_executor, if any, making tox
122+ # hang upon exit waiting for its threads and subprocesses (#3512).
123+ # Therefore, we make sure to close the existing back-end executor in the case of an existing PEP 517 frontend.
124+ if self ._frontend is not None :
125+ self ._frontend .backend_executor .close ()
126+
127+ self ._root = value
128+ self ._frontend_ = None # force recreating the frontend with new root
130129
131130 @staticmethod
132131 def id () -> str :
You can’t perform that action at this time.
0 commit comments