-
Notifications
You must be signed in to change notification settings - Fork 331
Closed
Description
I have faced with a problem with asserts: we are using PYTHONOPTIMIZE=2 on production environment so all asserts are cleaned from the execution (https://docs.python.org/3/using/cmdline.html#cmdoption-O). As the result, we getting the exception:
/opt/venv/lib/python3.9/site-packages/pdfkit/source.py in to_s(self)
52 # and cant later encode properly, this is a workaround for this.
53 # See issue #42
---> 54 if isinstance(self.source, unicode):
55 return self.source
56 else:
NameError: name 'unicode' is not defined
I would suggest to use something like sys.version to determine python versions.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels