Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 33ea591

Browse files
committed
more test fixed
1 parent 0ea9ae0 commit 33ea591

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

converters/base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class Converter(object):
7272
files_dir = str()
7373
with_preamble = True
7474
user_preamble = None
75-
output = str()
75+
output = unicode()
7676
raw_as_verbatim = False
7777

7878
def __init__(self, infile):
@@ -140,6 +140,7 @@ def render(self):
140140
if not hasattr(self, 'nb'):
141141
self.read()
142142
self.output = self.convert()
143+
assert(type(self.output) == unicode)
143144
return self.save()
144145

145146
def read(self):

converters/notebook.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from converters.base import Converter
2+
from converters.utils import cell_to_lines
23
from shutil import rmtree
34
import json
45

@@ -23,7 +24,7 @@ def __init__(self, infile, outbase):
2324
rmtree(self.files_dir)
2425

2526
def convert(self):
26-
return json.dumps(json.loads(Converter.convert(self, ',')), indent=1, sort_keys=True)
27+
return unicode(json.dumps(json.loads(Converter.convert(self, ',')), indent=1, sort_keys=True))
2728

2829
def optional_header(self):
2930
s = \

converters/utils.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
from __future__ import print_function
22
from lexers import IPythonLexer
3+
34
import subprocess
5+
import copy
6+
import json
47
import re
8+
59
from IPython.utils.text import indent
10+
from IPython.utils import path, py3compat
11+
from IPython.nbformat.v3.nbjson import BytesEncoder
612

713
#-----------------------------------------------------------------------------
814
# Utility functions

0 commit comments

Comments
 (0)