on xenial help sign in
Reorder imports, and start importing ProcessSeachError from the correct location in autopilot.
commit4fc5117c3e712c0dcb6fa361ca1aed7e94166362 authorThomi Richards <thomi.richards@canonical.com> dateThu 15 May 2014, 10:48 (12 years ago) parent5679368
1 file changed+11−4
tests/autopilot/unity8/process_helpers.py+11−4
tests/autopilot/unity8/process_helpers.py+11−4
@@ -17,12 +17,19 @@
1717# along with this program. If not, see <http://www.gnu.org/licenses/>.
1818#
1919
20−from autopilot.introspection import (
21− get_proxy_object_for_existing_process,
22− ProcessSearchError,
23−)
2420import logging
2521import subprocess
22+import sys
23+
24+# This has to work in both python 3 (ap 1.5) and py2 (ap legacy 1.4.1) so we
25+# pick the correct location in each case. Remove the py2 branch once we no
26+# longer need to support python 2.
27+if sys.version >= '3':
28+ from autopilot.exceptions import ProcessSearchError
29+else:
30+ from autopilot.introspection import ProcessSearchError
31+from autopilot.introspection import get_proxy_object_for_existing_process
32+
2633from unity8.shell import emulators
2734from unity8.shell.emulators import main_window as main_window_emulator
2835