Skip to content

Commit f736d9e

Browse files
committed
Make compadible with python>=3.6
1 parent f838806 commit f736d9e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

doc/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
author = "Bradley Steinfeld, Sam Prokopchuk, James Reeve"
2424

2525
# The full version, including alpha/beta/rc tags
26-
release = "0.20.4"
26+
release = "0.20.5"
2727

2828

2929
# -- General configuration ---------------------------------------------------

skillsnetwork/core.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
import tarfile
33
import zipfile
44
import IPython
5+
import os
56

67
from pathlib import Path
78
from urllib.parse import urlparse
89
from typing import List, Union, Optional, Iterable, Generator
910
from tqdm.auto import tqdm
10-
from os.path import relpath
1111

1212

1313
__all__ = [
@@ -136,7 +136,7 @@ def _verify_files_dont_exist(
136136
if path.exists() or path.is_symlink():
137137
if remove_if_exist:
138138
while path.is_symlink():
139-
temp = path.readlink()
139+
temp = Path(os.readlink(path))
140140
path.unlink(missing_ok=True)
141141
path = temp
142142
if path.exists():
@@ -187,7 +187,7 @@ async def download(
187187
async for chunk in _get_chunks(url, chunk_size):
188188
f.write(chunk)
189189
if verbose:
190-
print(f"Saved as '{relpath(path.resolve())}'")
190+
print(f"Saved as '{os.path.relpath(path.resolve())}'")
191191

192192

193193
async def read(url: str, chunk_size: int = DEFAULT_CHUNK_SIZE) -> bytes:
@@ -303,7 +303,7 @@ async def prepare(
303303
(path / child.name).symlink_to(child, target_is_directory=child.is_dir())
304304

305305
if verbose:
306-
print(f"Saved to '{relpath(path.resolve())}'")
306+
print(f"Saved to '{os.path.relpath(path.resolve())}'")
307307

308308

309309
def setup() -> None:

0 commit comments

Comments
 (0)