diff options
Diffstat (limited to 'chromium/third_party/catapult/common/py_vulcanize/py_vulcanize/parse_html_deps.py')
-rw-r--r-- | chromium/third_party/catapult/common/py_vulcanize/py_vulcanize/parse_html_deps.py | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/chromium/third_party/catapult/common/py_vulcanize/py_vulcanize/parse_html_deps.py b/chromium/third_party/catapult/common/py_vulcanize/py_vulcanize/parse_html_deps.py index 441edc5ed0d..5fee1774251 100644 --- a/chromium/third_party/catapult/common/py_vulcanize/py_vulcanize/parse_html_deps.py +++ b/chromium/third_party/catapult/common/py_vulcanize/py_vulcanize/parse_html_deps.py @@ -8,11 +8,13 @@ from __future__ import print_function import os import sys +import warnings from py_vulcanize import html_generation_controller from py_vulcanize import js_utils from py_vulcanize import module from py_vulcanize import strip_js_comments +import six def _AddToPathIfNeeded(path): @@ -24,19 +26,33 @@ def _InitBeautifulSoup(): catapult_path = os.path.abspath( os.path.join(os.path.dirname(__file__), os.path.pardir, os.path.pardir, os.path.pardir)) - bs_path = os.path.join(catapult_path, 'third_party', 'beautifulsoup4') + if six.PY3: + # Filter out warnings related to soupsieve from beautifulsoup. + # We do not need it and it generates unnecessary warnings during build. + warnings.filterwarnings('ignore', message='.*soupsieve.*', + category=UserWarning, module='bs4') + bs_path = os.path.join(catapult_path, 'third_party', 'beautifulsoup4-4.9.3', 'py3k') + else: + bs_path = os.path.join(catapult_path, 'third_party', 'beautifulsoup4') _AddToPathIfNeeded(bs_path) - html5lib_path = os.path.join(catapult_path, 'third_party', 'html5lib-python') + if six.PY3: + html5lib_path = os.path.join(catapult_path, 'third_party', 'html5lib-1.1') + else: + html5lib_path = os.path.join(catapult_path, 'third_party', 'html5lib-python') _AddToPathIfNeeded(html5lib_path) + if six.PY3: + webencodings_path = os.path.join( + catapult_path, 'third_party', 'webencodings-0.5.1') + _AddToPathIfNeeded(webencodings_path) + six_path = os.path.join(catapult_path, 'third_party', 'six') _AddToPathIfNeeded(six_path) _InitBeautifulSoup() import bs4 -import six class Script(object): |