Skip to content

Commit

Permalink
Make 'fmt' unicode always #70
Browse files Browse the repository at this point in the history
  • Loading branch information
mwouts committed Sep 11, 2018
1 parent b4c1234 commit 172103a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions jupytext/contentsmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@
from . import combine
from .file_format_version import check_file_version

try:
unicode # Python 2
except NameError:
unicode = str # Python 3


def _jupytext_writes(ext):
def _writes(nbk, version=nbformat.NO_CONVERT, **kwargs):
Expand Down Expand Up @@ -63,7 +58,9 @@ def check_formats(formats):
return check_formats([formats])
validated_group = []
for fmt in group:
if not isinstance(fmt, unicode):
try:
fmt = u'' + fmt
except UnicodeDecodeError:
raise ValueError('Extensions should be strings among {}'
', not {}.\n{}'
.format(str(jupytext.NOTEBOOK_EXTENSIONS),
Expand Down

0 comments on commit 172103a

Please sign in to comment.