Skip to content

Commit

Permalink
Fix hallucinations.
Browse files Browse the repository at this point in the history
  • Loading branch information
jsirois committed Aug 3, 2024
1 parent 852d52d commit 3a5eeab
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
6 changes: 0 additions & 6 deletions pex/globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,3 @@

class Globals(dict):
"""The globals dict returned by PEX executions that evaluate code without exiting / exec'ing."""

def __int__(self):
# type: () -> int

# When a globals dict is returned, this should always be interpreted as a successful exit.
return 0
2 changes: 1 addition & 1 deletion pex/pex.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ def execute(self):

result = self._wrap_coverage(self._wrap_profiling, self._execute)
if "PYTHONINSPECT" not in os.environ:
sys.exit(result)
sys.exit(0 if isinstance(result, Globals) else result)
else:
return result

Expand Down
2 changes: 1 addition & 1 deletion pex/pex_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ def _prepare_code(self):
inject_python_args={inject_python_args!r},
)
if should_exit:
sys.exit(result)
sys.exit(0 if is_globals else result)
elif is_globals:
globals().update(result)
"""
Expand Down

0 comments on commit 3a5eeab

Please sign in to comment.