vbuild
vbuild copied to clipboard
Error Minimizing JS
Running the example from the documentation for minimizing JavaScript:
>>> import vbuild
>>> js="""async function mymethod(...a) {
... var f=(...a) => {let b=12}
... }
... """
>>> min=vbuild.minimize(js)
Results in the following error:
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/vbuild.py", line 59, in jsminOnline
r = json.loads( response.read() )
File "/usr/lib/python3.5/json/__init__.py", line 312, in loads
s.__class__.__name__))
TypeError: the JSON object must be str, not 'bytes'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.5/dist-packages/vbuild.py", line 43, in minimize
return jsminOnline(code)
File "/usr/local/lib/python3.5/dist-packages/vbuild.py", line 63, in jsminOnline
raise VBuildException("minimize error: %s" % e)
vbuild.VBuildException: minimize error: the JSON object must be str, not 'bytes'
thanks ! (but in this case : I believe it's a py3.5 specific trouble ...)