mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 01:16:28 +03:00
Update Windows Python 2 link workaround to use helper functions
This commit is contained in:
parent
fdec758113
commit
97814f8da6
|
@ -5,7 +5,6 @@ import pip
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import importlib
|
import importlib
|
||||||
from .. import util
|
from .. import util
|
||||||
import sys
|
|
||||||
|
|
||||||
|
|
||||||
def link(origin, link_name, force=False):
|
def link(origin, link_name, force=False):
|
||||||
|
@ -44,10 +43,11 @@ def symlink(model_path, link_name, force):
|
||||||
elif link_path.exists():
|
elif link_path.exists():
|
||||||
link_path.unlink()
|
link_path.unlink()
|
||||||
|
|
||||||
if sys.version.startswith('2.') and sys.platform.startswith('win'):
|
# Add workaround for Python 2 on Windows (see issue #909)
|
||||||
|
if util.is_python2() and util.is_windows():
|
||||||
import subprocess
|
import subprocess
|
||||||
subprocess.call(['mklink','/d',str(link_path), str(model_path)],
|
command = ['mklink', '/d', link_path.as_posix(), model_path.as_posix()]
|
||||||
shell=True)
|
subprocess.call(command, shell=True)
|
||||||
else:
|
else:
|
||||||
link_path.symlink_to(model_path)
|
link_path.symlink_to(model_path)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user