Author: Amaury Forgeot d'Arc <amaur...@gmail.com> Branch: more-rposix Changeset: r77010:522f5cdaaac4 Date: 2015-05-01 22:33 +0200 http://bitbucket.org/pypy/pypy/changeset/522f5cdaaac4/
Log: ll_os_path is not used anymore diff --git a/rpython/rtyper/lltypesystem/module/ll_os_path.py b/rpython/rtyper/lltypesystem/module/ll_os_path.py deleted file mode 100644 --- a/rpython/rtyper/lltypesystem/module/ll_os_path.py +++ /dev/null @@ -1,7 +0,0 @@ -from rpython.rtyper.module.support import LLSupport -from rpython.rtyper.module.ll_os_path import BaseOsPath - -class Implementation(BaseOsPath, LLSupport): - pass - - diff --git a/rpython/rtyper/module/ll_os_path.py b/rpython/rtyper/module/ll_os_path.py deleted file mode 100644 --- a/rpython/rtyper/module/ll_os_path.py +++ /dev/null @@ -1,29 +0,0 @@ -""" -Dummy low-level implementations for the external functions of the 'os.path' module. -""" - -# see ll_os.py for comments - -import stat -import os - -# Does a path exist? -# This is false for dangling symbolic links. - -class BaseOsPath(object): - @classmethod - def ll_os_path_exists(cls, path): - """Test whether a path exists""" - try: - os.stat(cls.from_rstr_nonnull(path)) - except OSError: - return False - return True - - @classmethod - def ll_os_path_isdir(cls, path): - try: - st = os.stat(cls.from_rstr_nonnull(path)) - except OSError: - return False - return stat.S_ISDIR(st[0]) diff --git a/rpython/rtyper/module/test/test_ll_os_path.py b/rpython/rtyper/module/test/test_ll_os_path.py deleted file mode 100644 --- a/rpython/rtyper/module/test/test_ll_os_path.py +++ /dev/null @@ -1,53 +0,0 @@ -import py - -import sys, os - -from rpython.rtyper.lltypesystem.module.ll_os_path import Implementation as impl -from rpython.rtyper.test.test_llinterp import interpret -from rpython.tool.udir import udir - - -def test_exists(): - filename = impl.to_rstr(str(py.path.local(__file__))) - assert impl.ll_os_path_exists(filename) == True - assert not impl.ll_os_path_exists(impl.to_rstr( - "strange_filename_that_looks_improbable.sde")) - -def test_posixpath(): - import posixpath - def f(): - assert posixpath.join("/foo", "bar") == "/foo/bar" - assert posixpath.join("/foo", "spam/egg") == "/foo/spam/egg" - assert posixpath.join("/foo", "/bar") == "/bar" - interpret(f, []) - -def test_ntpath(): - import ntpath - def f(): - assert ntpath.join("\\foo", "bar") == "\\foo\\bar" - assert ntpath.join("c:\\foo", "spam\\egg") == "c:\\foo\\spam\\egg" - assert ntpath.join("c:\\foo", "d:\\bar") == "d:\\bar" - interpret(f, []) - -def test_isdir(): - if sys.platform != 'win32': - py.test.skip("XXX cannot run os.stat() on the llinterp yet") - - s = str(udir.join('test_isdir')) - def f(): - return os.path.isdir(s) - res = interpret(f, []) - assert res == os.path.isdir(s) - os.mkdir(s) - res = interpret(f, []) - assert res is True - - # On Windows, the libc stat() is flawed: - # stat('c:/temp') works - # but stat('c:/temp/') does not find the directory... - # This test passes with our own stat() implementation. - s += os.path.sep - def f(): - return os.path.isdir(s) - res = interpret(f, []) - assert res is True _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit