Skip to content

Commit

Permalink
Fix RuntimeWarning
Browse files Browse the repository at this point in the history
 'hissp.repl' found in sys.modules after import of package
 'hissp', but prior to execution of 'hissp.repl'; this may result in
 'unpredictable behaviour

Remove direct repl entry point. It is no longer required.

Use hissp's __main__.py instead.
  • Loading branch information
gilch committed May 26, 2023
1 parent a499339 commit 2359463
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions src/hissp/repl.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,3 @@ def main(__main__=None):

repl.locals["_macro_"] = SimpleNamespace(**vars(hissp.macros._macro_))
repl.interact()


if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion tests/test_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def test_i_file_args():


def test_repl_read_exception():
out, err = cmd("python -m hissp.repl", ".#(operator..truediv 1 0)\n")
out, err = cmd("python -m hissp", ".#(operator..truediv 1 0)\n")
assert ">>> # Compilation failed!\nTraceback (most recent call last):\n F" in err
assert "\nZeroDivisionError: division by zero" in err
assert out.count("#> ") == 2
Expand Down

0 comments on commit 2359463

Please sign in to comment.