Skip to content

Commit 323d0c9

Browse files
authored
Merge pull request #13 from paulovn/feature/python3
bugfixes
2 parents a4e496f + 1c62675 commit 323d0c9

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

sparqlkernel/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
__version__ = '1.0.1'
2+
__version__ = '1.0.2'
33

44
KERNEL_NAME = 'sparql'
55
LANGUAGE = 'sparql'

sparqlkernel/install.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121

2222
from .constants import __version__, KERNEL_NAME, DISPLAY_NAME, LANGUAGE
2323

24+
PY3 = sys.version_info[0] == 3
25+
if PY3:
26+
unicode = str
27+
2428
MODULEDIR = os.path.dirname(__file__)
2529
PKGNAME = os.path.basename( MODULEDIR )
2630

@@ -96,7 +100,7 @@ def install_custom_css( destdir, cssfile, resource=PKGNAME ):
96100
if os.path.exists( custom ):
97101
with open( custom, 'rt' ) as fin:
98102
for line in fin:
99-
fout.write( line )
103+
fout.write( unicode(line) )
100104
os.rename( custom+'-new',custom)
101105

102106

@@ -106,6 +110,8 @@ def remove_custom_css(destdir, resource=PKGNAME ):
106110
"""
107111

108112
# Remove the inclusion in the main CSS
113+
if not os.path.isdir( destdir ):
114+
return False
109115
custom = os.path.join( destdir, 'custom.css' )
110116
copy = True
111117
found = False

0 commit comments

Comments
 (0)