Skip to content

Commit 96c4b2d

Browse files
吕传承吕传承
authored andcommitted
Modify the path
1 parent 79d2fdc commit 96c4b2d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

OpenHowNet/Download.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import zipfile
55

66
OPENHOWNET_DATA_URL = "https://thunlp.oss-cn-qingdao.aliyuncs.com/OpenHowNet/resources.zip"
7-
OPENHOWNET_RESOURCE_PATH = os.path.join("~", ".openhownet")
7+
OPENHOWNET_RESOURCE_PATH = os.path.join(os.path.expanduser('~'), ".openhownet")
88

99

1010
def get_resource(path, mode='r', encoding='utf-8'):
@@ -53,7 +53,7 @@ def download():
5353
The HowNet resource file is openhownet_data.zip.
5454
'''
5555
if not os.path.exists(os.path.join(OPENHOWNET_RESOURCE_PATH, 'resources')):
56-
os.mkdir(os.path.join(OPENHOWNET_RESOURCE_PATH, 'resources'))
56+
os.makedirs(os.path.join(OPENHOWNET_RESOURCE_PATH, 'resources'))
5757
data_zip_path = download_file(
5858
OPENHOWNET_DATA_URL, dest_file=os.path.join("resources", "resources.zip"))
5959
with zipfile.ZipFile(data_zip_path, 'r') as zip_ref:

0 commit comments

Comments
 (0)