Skip to content

Commit

Permalink
Allow loading from bytes paths.
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminp committed Jan 7, 2020
1 parent f4f0b84 commit b809210
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ def test_dump():

def test_paths():
toml.load("test.toml")
toml.load(b"test.toml")
import sys
if (3, 4) <= sys.version_info:
import pathlib
Expand Down
2 changes: 1 addition & 1 deletion toml/decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def _detect_pathlib_path(p):


def _ispath(p):
if isinstance(p, basestring):
if isinstance(p, (bytes, basestring)):
return True
return _detect_pathlib_path(p)

Expand Down

0 comments on commit b809210

Please sign in to comment.