未验证 提交 92817f80 编写于 作者: 1 123malin 提交者: GitHub

test=develop, rm pathlib (#28658)

* test=develop, rm pathlib
上级 4fd4095d
...@@ -61,7 +61,6 @@ requirements: ...@@ -61,7 +61,6 @@ requirements:
- graphviz - graphviz
- protobuf - protobuf
- py-cpuinfo==5.0.0 - py-cpuinfo==5.0.0
- pathlib
- astor - astor
- gast>=0.3.3 - gast>=0.3.3
- matplotlib - matplotlib
...@@ -79,7 +78,6 @@ requirements: ...@@ -79,7 +78,6 @@ requirements:
- graphviz - graphviz
- protobuf - protobuf
- astor - astor
- pathlib
- gast>=0.3.3 - gast>=0.3.3
- py-cpuinfo==5.0.0 - py-cpuinfo==5.0.0
""" """
......
...@@ -29,7 +29,6 @@ import paddle.fluid as fluid ...@@ -29,7 +29,6 @@ import paddle.fluid as fluid
from paddle.fluid import core from paddle.fluid import core
import functools import functools
from pathlib import PurePosixPath, Path
import shutil import shutil
__all__ = ['LocalFS', 'HDFSClient'] __all__ = ['LocalFS', 'HDFSClient']
...@@ -322,7 +321,7 @@ class LocalFS(FS): ...@@ -322,7 +321,7 @@ class LocalFS(FS):
return return
raise FSFileExistsError raise FSFileExistsError
return Path(fs_path).touch(exist_ok=True) os.system("touch {}".format(fs_path))
def mv(self, src_path, dst_path, overwrite=False, test_exists=False): def mv(self, src_path, dst_path, overwrite=False, test_exists=False):
""" """
...@@ -554,11 +553,11 @@ class HDFSClient(FS): ...@@ -554,11 +553,11 @@ class HDFSClient(FS):
if len(arr) != 8: if len(arr) != 8:
continue continue
p = PurePosixPath(arr[7]) p = os.path.basename(arr[7])
if arr[0][0] == 'd': if arr[0][0] == 'd':
dirs.append(p.name) dirs.append(p)
else: else:
files.append(p.name) files.append(p)
return dirs, files return dirs, files
......
...@@ -30,7 +30,6 @@ from .fs import FS, LocalFS, FSFileExistsError, FSFileNotExistsError, ExecuteErr ...@@ -30,7 +30,6 @@ from .fs import FS, LocalFS, FSFileExistsError, FSFileNotExistsError, ExecuteErr
from paddle.fluid import core from paddle.fluid import core
import functools import functools
from pathlib import PurePosixPath, Path
import shutil import shutil
__all__ = ["HDFSClient"] __all__ = ["HDFSClient"]
...@@ -137,11 +136,11 @@ class HDFSClient(FS): ...@@ -137,11 +136,11 @@ class HDFSClient(FS):
if len(arr) != 8: if len(arr) != 8:
continue continue
p = PurePosixPath(arr[7]) p = os.path.basename(arr[7])
if arr[0][0] == 'd': if arr[0][0] == 'd':
dirs.append(p.name) dirs.append(p)
else: else:
files.append(p.name) files.append(p)
return dirs, files return dirs, files
......
...@@ -12,4 +12,3 @@ Pillow ...@@ -12,4 +12,3 @@ Pillow
six six
decorator decorator
astor astor
pathlib
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册