提交 6ef1ccdd 编写于 作者: H helinwang 提交者: GitHub

Merge pull request #2536 from helinwang/2535

Fix unit test error: File exists: '/root/.cache/paddle/dataset'
......@@ -15,6 +15,7 @@
import requests
import hashlib
import os
import errno
import shutil
import sys
import importlib
......@@ -27,7 +28,12 @@ __all__ = ['DATA_HOME', 'download', 'md5file', 'split', 'cluster_files_reader']
DATA_HOME = os.path.expanduser('~/.cache/paddle/dataset')
if not os.path.exists(DATA_HOME):
os.makedirs(DATA_HOME)
try:
os.makedirs(DATA_HOME)
except OSError as exc:
if exc.errno != errno.EEXIST:
raise
pass
def md5file(fname):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册