Skip to content

Commit bfe2c33

Browse files
committed
Fix compatibility with Python 2.7 and Python 3.4 – 3.5 on Windows (which also doesn't have os.fwalk)
1 parent 6ba863b commit bfe2c33

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ipfshttpclient/multipart.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,13 +380,13 @@ def __init__(self, directory,
380380
for pattern in patterns:
381381
self.patterns.append(glob_compile(pattern) if isinstance(pattern, str) else pattern)
382382

383-
self.directory = directory
383+
self.directory = utils.convert_path(directory)
384384
if not isinstance(self.directory, int):
385-
self.directory = os.path.normpath(directory)
385+
self.directory = os.path.normpath(self.directory)
386386
self.recursive = recursive
387387
self.dirname = dirname
388388

389-
name = os.path.basename(directory) if not isinstance(directory, int) else ""
389+
name = os.path.basename(self.directory) if not isinstance(self.directory, int) else ""
390390
super(DirectoryStream, self).__init__(name, chunk_size=chunk_size)
391391

392392
def _body_directory(self, short_path, visited_directories):

0 commit comments

Comments
 (0)