Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, message):
error_msg = message + ', note that only a subset of Python is supported'
super(Py2JSNameError, self).__init__(error_msg)
def visit_NameConstant(self, node):
"""Turn a Python nameconstant expression into JavaScript code."""
if node.value is False:
return 'false'
if node.value is True:
return 'true'
if node.value is None:
return 'null'
raise Py2JSNameError('name \'{}\' is not defined'.format(str(node.value)))