Commit 18ec5bbb authored by Roman Yurchak's avatar Roman Yurchak

Also dedent code in find_imports

parent 30d15038
......@@ -48,6 +48,9 @@ def find_imports(code):
Finds the imports in a string of code and returns a list of their package
names.
"""
# handle mis-indented input from multi-line strings
code = dedent(code)
mod = ast.parse(code)
imports = set()
for node in ast.walk(mod):
......
......@@ -107,9 +107,6 @@ class SeleniumWrapper:
def run_async(self, code):
from selenium.common.exceptions import TimeoutException
if isinstance(code, str) and code.startswith('\n'):
# we have a multiline string, fix indentation
code = textwrap.dedent(code)
self.run_js(
"""
window.done = false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment