diff --git a/python/paddle/v2/dataset/common.py b/python/paddle/v2/dataset/common.py index 9c614914b5e372e8e5e3c3c072b18b83edf51e87..e09ac1a7a0fe70dbf58a04f51cdf6916485e9be1 100644 --- a/python/paddle/v2/dataset/common.py +++ b/python/paddle/v2/dataset/common.py @@ -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):