Skip to content

Commit c742e38

Browse files
Fix SyntaxWarning in Python 3.14
1 parent 4e08180 commit c742e38

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

piptools/build.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -204,12 +204,11 @@ def _env_var(
204204
finally:
205205
if pip_constraint_was_unset:
206206
del os.environ[env_var_name]
207-
return
208-
209-
# Assert here is necessary because MyPy can't infer type
210-
# narrowing in the complex case.
211-
assert isinstance(original_pip_constraint, str)
212-
os.environ[env_var_name] = original_pip_constraint
207+
else:
208+
# Assert here is necessary because MyPy can't infer type
209+
# narrowing in the complex case.
210+
assert isinstance(original_pip_constraint, str)
211+
os.environ[env_var_name] = original_pip_constraint
213212

214213

215214
@contextlib.contextmanager

0 commit comments

Comments
 (0)