diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-01-13 10:48:19 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-01-14 11:36:49 +0000 |
commit | ae0642dfcc2c4817c63a91a6041d302f0526fc47 (patch) | |
tree | 4713426a5c2eec7ac0c15af2c9f2a4d62ba6790c /bitbake | |
parent | 34ce32a75bf2dba51cf11192be9d9563e2952840 (diff) | |
download | poky-ae0642dfcc2c4817c63a91a6041d302f0526fc47.tar.gz |
bitbake: bs4/element: Fix DeprecationWarning
./lib/bs4/element.py:1565: DeprecationWarning: Using or importing the
ABCs from 'collections' instead of from 'collections.abc' is deprecated,
and in 3.8 it will stop working
(Bitbake rev: 52a144a7daa94b2bd239d582cb71d1f03119918f)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bs4/element.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/bitbake/lib/bs4/element.py b/bitbake/lib/bs4/element.py index 0e62c2e100..0c30759ffc 100644 --- a/bitbake/lib/bs4/element.py +++ b/bitbake/lib/bs4/element.py | |||
@@ -1,7 +1,7 @@ | |||
1 | __license__ = "MIT" | 1 | __license__ = "MIT" |
2 | 2 | ||
3 | from pdb import set_trace | 3 | from pdb import set_trace |
4 | import collections | 4 | import collections.abc |
5 | import re | 5 | import re |
6 | import sys | 6 | import sys |
7 | import warnings | 7 | import warnings |
@@ -155,7 +155,7 @@ class PageElement(object): | |||
155 | 155 | ||
156 | def format_string(self, s, formatter='minimal'): | 156 | def format_string(self, s, formatter='minimal'): |
157 | """Format the given string using the given formatter.""" | 157 | """Format the given string using the given formatter.""" |
158 | if not isinstance(formatter, collections.Callable): | 158 | if not isinstance(formatter, collections.abc.Callable): |
159 | formatter = self._formatter_for_name(formatter) | 159 | formatter = self._formatter_for_name(formatter) |
160 | if formatter is None: | 160 | if formatter is None: |
161 | output = s | 161 | output = s |
@@ -1077,7 +1077,7 @@ class Tag(PageElement): | |||
1077 | 1077 | ||
1078 | # First off, turn a string formatter into a function. This | 1078 | # First off, turn a string formatter into a function. This |
1079 | # will stop the lookup from happening over and over again. | 1079 | # will stop the lookup from happening over and over again. |
1080 | if not isinstance(formatter, collections.Callable): | 1080 | if not isinstance(formatter, collections.abc.Callable): |
1081 | formatter = self._formatter_for_name(formatter) | 1081 | formatter = self._formatter_for_name(formatter) |
1082 | 1082 | ||
1083 | attrs = [] | 1083 | attrs = [] |
@@ -1181,7 +1181,7 @@ class Tag(PageElement): | |||
1181 | """ | 1181 | """ |
1182 | # First off, turn a string formatter into a function. This | 1182 | # First off, turn a string formatter into a function. This |
1183 | # will stop the lookup from happening over and over again. | 1183 | # will stop the lookup from happening over and over again. |
1184 | if not isinstance(formatter, collections.Callable): | 1184 | if not isinstance(formatter, collections.abc.Callable): |
1185 | formatter = self._formatter_for_name(formatter) | 1185 | formatter = self._formatter_for_name(formatter) |
1186 | 1186 | ||
1187 | pretty_print = (indent_level is not None) | 1187 | pretty_print = (indent_level is not None) |
@@ -1562,7 +1562,7 @@ class SoupStrainer(object): | |||
1562 | def _normalize_search_value(self, value): | 1562 | def _normalize_search_value(self, value): |
1563 | # Leave it alone if it's a Unicode string, a callable, a | 1563 | # Leave it alone if it's a Unicode string, a callable, a |
1564 | # regular expression, a boolean, or None. | 1564 | # regular expression, a boolean, or None. |
1565 | if (isinstance(value, str) or isinstance(value, collections.Callable) or hasattr(value, 'match') | 1565 | if (isinstance(value, str) or isinstance(value, collections.abc.Callable) or hasattr(value, 'match') |
1566 | or isinstance(value, bool) or value is None): | 1566 | or isinstance(value, bool) or value is None): |
1567 | return value | 1567 | return value |
1568 | 1568 | ||
@@ -1602,7 +1602,7 @@ class SoupStrainer(object): | |||
1602 | markup = markup_name | 1602 | markup = markup_name |
1603 | markup_attrs = markup | 1603 | markup_attrs = markup |
1604 | call_function_with_tag_data = ( | 1604 | call_function_with_tag_data = ( |
1605 | isinstance(self.name, collections.Callable) | 1605 | isinstance(self.name, collections.abc.Callable) |
1606 | and not isinstance(markup_name, Tag)) | 1606 | and not isinstance(markup_name, Tag)) |
1607 | 1607 | ||
1608 | if ((not self.name) | 1608 | if ((not self.name) |
@@ -1688,7 +1688,7 @@ class SoupStrainer(object): | |||
1688 | # True matches any non-None value. | 1688 | # True matches any non-None value. |
1689 | return markup is not None | 1689 | return markup is not None |
1690 | 1690 | ||
1691 | if isinstance(match_against, collections.Callable): | 1691 | if isinstance(match_against, collections.abc.Callable): |
1692 | return match_against(markup) | 1692 | return match_against(markup) |
1693 | 1693 | ||
1694 | # Custom callables take the tag as an argument, but all | 1694 | # Custom callables take the tag as an argument, but all |