Handle float in _convert_js_arg
This fixes 'gg' with QtWebEngine.
This commit is contained in:
parent
96087bd554
commit
627f743c26
@ -55,7 +55,7 @@ def _convert_js_arg(arg):
|
||||
return 'undefined'
|
||||
elif isinstance(arg, str):
|
||||
return '"{}"'.format(string_escape(arg))
|
||||
elif isinstance(arg, int):
|
||||
elif isinstance(arg, (int, float)):
|
||||
return str(arg)
|
||||
else:
|
||||
raise TypeError("Don't know how to handle {!r} of type {}!".format(
|
||||
|
@ -126,6 +126,7 @@ class TestStringEscape:
|
||||
('foobar', '"foobar"'),
|
||||
('foo\\bar', r'"foo\\bar"'),
|
||||
(42, '42'),
|
||||
(23.42, '23.42'),
|
||||
(None, 'undefined'),
|
||||
(object(), TypeError),
|
||||
])
|
||||
|
Loading…
Reference in New Issue
Block a user