Skip to content

Commit

Permalink
Replace '/' with '\'
Browse files Browse the repository at this point in the history
  • Loading branch information
benmcalister committed Jan 14, 2022
1 parent bebd05f commit 77126bd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyshex/utils/url_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ def generate_base(path: str) -> str:
:param path: file location or url
:return: file location or url sans actual name
"""
if ':' in path:
if '://' in path:
parts = urlparse(path)
parts_dict = parts._asdict()
parts_dict['path'] = os.path.split(parts.path)[0] if '/' in parts.path else ''
return urlunparse(ParseResult(**parts_dict)) + '/'
else:
return (os.path.split(path)[0] if '/' in path else '') + '/'
return (os.path.split(path)[0] if '/' in path else '').replace('\\', '/') + '/'

0 comments on commit 77126bd

Please sign in to comment.