Skip to content

Commit

Permalink
android: customtabs_benchmark: fix import for py3
Browse files Browse the repository at this point in the history
The run_benchmark.py was converted to py3 without running it. With
--help it fails like this:

```
  File "/path/to/run_benchmark.py", line 17, in <module>
    from . import customtabs_benchmark
ImportError: attempted relative import with no known parent package
```

Adding the path and importing as 'import customtabs_benchmark'.

Bug: 1154224
Change-Id: I5741dd0aa07685cb79b268bfc0119e40fe68523c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3226108
Reviewed-by: Benoit L <lizeb@chromium.org>
Commit-Queue: Egor Pasko <pasko@chromium.org>
Cr-Commit-Position: refs/heads/main@{#932066}
  • Loading branch information
pasko authored and Chromium LUCI CQ committed Oct 15, 2021
1 parent c642a79 commit 96acdfb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tools/android/customtabs_benchmark/scripts/run_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
import sys
import threading

from . import customtabs_benchmark

_SRC_PATH = os.path.abspath(os.path.join(
os.path.dirname(__file__), '..', '..', '..', '..'))

Expand All @@ -25,6 +23,10 @@
sys.path.append(os.path.join(_SRC_PATH, 'build', 'android'))
import devil_chromium

sys.path.append(
os.path.join(_SRC_PATH, 'tools', 'android', 'customtabs_benchmark',
'scripts'))
import customtabs_benchmark

_KEYS = ['url', 'warmup', 'skip_launcher_activity', 'speculation_mode',
'delay_to_may_launch_url', 'delay_to_launch_url', 'cold',
Expand Down

0 comments on commit 96acdfb

Please sign in to comment.