Skip to content

Commit 0aa6afe

Browse files
committed
support unicode keyword on Python 3
1 parent 48033ec commit 0aa6afe

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pdfkit/pdfkit.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
1010
try:
1111
# Python 2.x and 3.x support for checking string types
1212
assert basestring
13+
assert unicode
1314
except NameError:
1415
basestring = str
16+
unicode = str
1517

1618

1719
class PDFKit(object):
@@ -53,7 +55,8 @@ def __init__(self, url_or_file, type_, options=None, toc=None, cover=None,
5355

5456
self.environ = self.configuration.environ
5557

56-
if options is not None: self.options.update(options)
58+
if options is not None:
59+
self.options.update(options)
5760

5861
self.toc = {} if toc is None else toc
5962
self.cover = cover
@@ -211,7 +214,7 @@ def _normalize_options(self, options):
211214
"""
212215

213216
for key, value in list(options.items()):
214-
if not '--' in key:
217+
if '--' not in key:
215218
normalized_key = '--%s' % self._normalize_arg(key)
216219
else:
217220
normalized_key = self._normalize_arg(key)

0 commit comments

Comments
 (0)