diff options
Diffstat (limited to 'bitbake/lib/bs4')
-rw-r--r-- | bitbake/lib/bs4/dammit.py | 12 | ||||
-rw-r--r-- | bitbake/lib/bs4/element.py | 8 |
2 files changed, 10 insertions, 10 deletions
diff --git a/bitbake/lib/bs4/dammit.py b/bitbake/lib/bs4/dammit.py index 68d419feb5..805aa908a5 100644 --- a/bitbake/lib/bs4/dammit.py +++ b/bitbake/lib/bs4/dammit.py | |||
@@ -45,9 +45,9 @@ except ImportError: | |||
45 | pass | 45 | pass |
46 | 46 | ||
47 | xml_encoding_re = re.compile( | 47 | xml_encoding_re = re.compile( |
48 | '^<\?.*encoding=[\'"](.*?)[\'"].*\?>'.encode(), re.I) | 48 | r'^<\?.*encoding=[\'"](.*?)[\'"].*\?>'.encode(), re.I) |
49 | html_meta_re = re.compile( | 49 | html_meta_re = re.compile( |
50 | '<\s*meta[^>]+charset\s*=\s*["\']?([^>]*?)[ /;\'">]'.encode(), re.I) | 50 | r'<\s*meta[^>]+charset\s*=\s*["\']?([^>]*?)[ /;\'">]'.encode(), re.I) |
51 | 51 | ||
52 | class EntitySubstitution(object): | 52 | class EntitySubstitution(object): |
53 | 53 | ||
@@ -80,11 +80,11 @@ class EntitySubstitution(object): | |||
80 | ">": "gt", | 80 | ">": "gt", |
81 | } | 81 | } |
82 | 82 | ||
83 | BARE_AMPERSAND_OR_BRACKET = re.compile("([<>]|" | 83 | BARE_AMPERSAND_OR_BRACKET = re.compile(r"([<>]|" |
84 | "&(?!#\d+;|#x[0-9a-fA-F]+;|\w+;)" | 84 | r"&(?!#\d+;|#x[0-9a-fA-F]+;|\w+;)" |
85 | ")") | 85 | r")") |
86 | 86 | ||
87 | AMPERSAND_OR_BRACKET = re.compile("([<>&])") | 87 | AMPERSAND_OR_BRACKET = re.compile(r"([<>&])") |
88 | 88 | ||
89 | @classmethod | 89 | @classmethod |
90 | def _substitute_html_entity(cls, matchobj): | 90 | def _substitute_html_entity(cls, matchobj): |
diff --git a/bitbake/lib/bs4/element.py b/bitbake/lib/bs4/element.py index 0c30759ffc..3775a60458 100644 --- a/bitbake/lib/bs4/element.py +++ b/bitbake/lib/bs4/element.py | |||
@@ -10,7 +10,7 @@ from bs4.dammit import EntitySubstitution | |||
10 | DEFAULT_OUTPUT_ENCODING = "utf-8" | 10 | DEFAULT_OUTPUT_ENCODING = "utf-8" |
11 | PY3K = (sys.version_info[0] > 2) | 11 | PY3K = (sys.version_info[0] > 2) |
12 | 12 | ||
13 | whitespace_re = re.compile("\s+") | 13 | whitespace_re = re.compile(r"\s+") |
14 | 14 | ||
15 | def _alias(attr): | 15 | def _alias(attr): |
16 | """Alias one attribute name to another for backward compatibility""" | 16 | """Alias one attribute name to another for backward compatibility""" |
@@ -67,7 +67,7 @@ class ContentMetaAttributeValue(AttributeValueWithCharsetSubstitution): | |||
67 | The value of the 'content' attribute will be one of these objects. | 67 | The value of the 'content' attribute will be one of these objects. |
68 | """ | 68 | """ |
69 | 69 | ||
70 | CHARSET_RE = re.compile("((^|;)\s*charset=)([^;]*)", re.M) | 70 | CHARSET_RE = re.compile(r"((^|;)\s*charset=)([^;]*)", re.M) |
71 | 71 | ||
72 | def __new__(cls, original_value): | 72 | def __new__(cls, original_value): |
73 | match = cls.CHARSET_RE.search(original_value) | 73 | match = cls.CHARSET_RE.search(original_value) |
@@ -580,7 +580,7 @@ class PageElement(object): | |||
580 | 580 | ||
581 | # Methods for supporting CSS selectors. | 581 | # Methods for supporting CSS selectors. |
582 | 582 | ||
583 | tag_name_re = re.compile('^[a-zA-Z0-9][-.a-zA-Z0-9:_]*$') | 583 | tag_name_re = re.compile(r'^[a-zA-Z0-9][-.a-zA-Z0-9:_]*$') |
584 | 584 | ||
585 | # /^([a-zA-Z0-9][-.a-zA-Z0-9:_]*)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/ | 585 | # /^([a-zA-Z0-9][-.a-zA-Z0-9:_]*)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/ |
586 | # \---------------------------/ \---/\-------------/ \-------/ | 586 | # \---------------------------/ \---/\-------------/ \-------/ |
@@ -1364,7 +1364,7 @@ class Tag(PageElement): | |||
1364 | if tag_name == '': | 1364 | if tag_name == '': |
1365 | raise ValueError( | 1365 | raise ValueError( |
1366 | "A pseudo-class must be prefixed with a tag name.") | 1366 | "A pseudo-class must be prefixed with a tag name.") |
1367 | pseudo_attributes = re.match('([a-zA-Z\d-]+)\(([a-zA-Z\d]+)\)', pseudo) | 1367 | pseudo_attributes = re.match(r'([a-zA-Z\d-]+)\(([a-zA-Z\d]+)\)', pseudo) |
1368 | found = [] | 1368 | found = [] |
1369 | if pseudo_attributes is None: | 1369 | if pseudo_attributes is None: |
1370 | pseudo_type = pseudo | 1370 | pseudo_type = pseudo |