Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1106)

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/factory.py

Issue 2474003002: webkitpy: Don't fail if importing a port fails. (Closed)
Patch Set: webkitpy: Don't fail if importing a port fails. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/factory.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/factory.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/factory.py
index 95d2454f0563cfe69dc3b63507292284845ea823..05d7bc33febb580903b5f266e3de6d65f470dbcd 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/factory.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/factory.py
@@ -31,6 +31,7 @@
import fnmatch
import optparse
import re
+import warnings
from webkitpy.common.webkit_finder import WebKitFinder
@@ -162,7 +163,12 @@ class PortFactory(object):
else:
for port_class in self.PORT_CLASSES:
module_name, class_name = port_class.rsplit('.', 1)
- module = __import__(module_name, globals(), locals(), [], -1)
+ try:
+ module = __import__(module_name, globals(), locals(), [], -1)
+ except ImportError as exp:
+ warnings.warn(
+ 'Unable to import %s (%s)' % (module_name, exp), stacklevel=2)
+ continue
cls = module.__dict__[class_name]
if port_name.startswith(cls.port_name):
port_name = cls.determine_full_port_name(self._host, options, port_name)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698