on xenial help sign in
Use new import location for ProcessSearchError in process_helpers script.
commit93503fa309b63c301878e83348d695e25c446f37 authorThomi Richards <thomi.richards@canonical.com> dateFri 16 May 2014, 18:45 (12 years ago) parent3a15adc4fc5117
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