8000 Remove dummy_os import and update filecmp from CPython 3.12.2 by youknowone · Pull Request #5258 · RustPython/RustPython · GitHub
[go: up one dir, main page]

Skip to content

Remove dummy_os import and update filecmp from CPython 3.12.2 #5258

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -275,11 +275,11 @@ jobs:
run: target/release/rustpython -m test -j 1 -u all --slowest --fail-env-changed -v -x ${{ env.PLATFORM_INDEPENDENT_TESTS }}
- if: runner.os == 'macOS'
name: run cpython platform-dependent tests (MacOS)
run: target/release/rustpython -m test -j 1 all --slowest --fail-env-changed -v -x ${{ env.PLATFORM_INDEPENDENT_TESTS }} ${{ env.MACOS_SKIPS }}
run: target/release/rustpython -m test -j 1 --slowest --fail-env-changed -v -x ${{ env.PLATFORM_INDEPENDENT_TESTS }} ${{ env.MACOS_SKIPS }}
- if: runner.os == 'Windows'
name: run cpython platform-dependent tests (windows partial - fixme)
run:
target/release/rustpython -m test -j 1 all --slowest --fail-env-changed -v -x ${{ env.PLATFORM_INDEPENDENT_TESTS }} ${{ env.WINDOWS_SKIPS }}
target/release/rustpython -m test -j 1 --slowest --fail-env-changed -v -x ${{ env.PLATFORM_INDEPENDENT_TESTS }} ${{ env.WINDOWS_SKIPS }}
- if: runner.os != 'Windows'
name: check that --install-pip succeeds
run: |
Expand Down
13 changes: 5 additions & 8 deletions Lib/filecmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@

"""

try:
import os
except ImportError:
import _dummy_os as os
import os
import stat
from itertools import filterfalse
from types import GenericAlias
Expand Down Expand Up @@ -160,17 +157,17 @@ def phase2(self): # Distinguish files, directories, funnies
a_path = os.path.join(self.left, x)
b_path = os.path.join(self.right, x)

ok = 1
ok = True
try:
a_stat = os.stat(a_path)
except OSError:
# print('Can\'t stat', a_path, ':', why.args[1])
ok = 0
ok = False
try:
b_stat = os.stat(b_path)
except OSError:
# print('Can\'t stat', b_path, ':', why.args[1])
ok = 0
ok = False

if ok:
a_type = stat.S_IFMT(a_stat.st_mode)
Expand Down Expand Up @@ -245,7 +242,7 @@ def report_full_closure(self): # Report on self and subdirs recursively

methodmap = dict(subdirs=phase4,
same_files=phase3, diff_files=phase3, funny_files=phase3,
common_dirs = phase2, common_files=phase2, common_funny=phase2,
common_dirs=phase2, common_files=phase2, common_funny=phase2,
common=phase1, left_only=phase1, right_only=phase1,
left_list=phase0, right_list=phase0)

Expand Down
5 changes: 1 addition & 4 deletions Lib/genericpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
Do not use directly. The OS specific modules import the appropriate
functions from this module themselves.
"""
try:
import os
except ImportError:
import _dummy_os as os
import os
import stat

__all__ = ['commonprefix', 'exists', 'getatime', 'getctime', 'getmtime',
Expand Down
Loading
0