Skip to content

Commit 15abf28

Browse files
committed
Remove workarounds for fixed PyPy __file__ bug
1 parent 2f3beb9 commit 15abf28

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

hy/cmdline.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from pathlib import Path
1313

1414
import hy
15-
from hy._compat import PY3_9, PYPY
15+
from hy._compat import PY3_9
1616
from hy.compiler import hy_compile, hy_eval
1717
from hy.errors import HyLanguageError, filtered_hy_exceptions, hy_exc_handler
1818
from hy.importer import runhy
@@ -270,7 +270,7 @@ def proc_opt(opt, arg=None, item=None, i=None):
270270
set_path(filename)
271271
# Ensure __file__ is set correctly in the code we're about
272272
# to run.
273-
if PY3_9 and not PYPY:
273+
if PY3_9:
274274
if not filename.is_absolute():
275275
filename = Path.cwd() / filename
276276
if platform.system() == "Windows":

tests/test_bin.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
import pytest
1313

14-
from hy._compat import PY3_9, PYODIDE, PYPY
14+
from hy._compat import PY3_9, PYODIDE
1515

1616
if PYODIDE:
1717
pytest.skip(
@@ -681,7 +681,6 @@ def test_output_buffering(tmp_path):
681681
assert tf.read_text().splitlines() == ["line 1", "line 2"]
682682

683683

684-
@pytest.mark.skipif(PYPY, reason = 'https://foss.heptapod.net/pypy/pypy/-/issues/3881')
685684
def test_uufileuu(tmp_path, monkeypatch):
686685
# `__file__` should be set the same way as in Python.
687686
# https://github.com/hylang/hy/issues/2318
@@ -691,7 +690,7 @@ def test_uufileuu(tmp_path, monkeypatch):
691690
(tmp_path / "realdir" / "pyex.py").write_text('print(__file__)')
692691

693692
def file_is(arg, expected_py3_9):
694-
expected = expected_py3_9 if PY3_9 and not PYPY else Path(arg)
693+
expected = expected_py3_9 if PY3_9 else Path(arg)
695694
output, _ = run_cmd(["python3", arg + "pyex.py"])
696695
assert output.rstrip() == str(expected / "pyex.py")
697696
output, _ = run_cmd(["hy", arg + "hyex.hy"])

0 commit comments

Comments
 (0)