diff options
author | Leonard Richardson <leonardr@segfault.org> | 2015-06-25 21:02:02 -0400 |
---|---|---|
committer | Leonard Richardson <leonardr@segfault.org> | 2015-06-25 21:02:02 -0400 |
commit | 89a4bcc0e1053ff75cd22e6dba8edc8eff387385 (patch) | |
tree | b8885c630935bfad3a368b1914b410c10e5f7d98 /bs4/element.py | |
parent | 0b9b0976b5219233bee143c09a3f35fc2a44d20e (diff) |
Make it possible to invoke the Tag() constructor without providing a builder. [bug=1307471]
Diffstat (limited to 'bs4/element.py')
-rw-r--r-- | bs4/element.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/bs4/element.py b/bs4/element.py index 7fdeb08..95b6735 100644 --- a/bs4/element.py +++ b/bs4/element.py @@ -782,9 +782,12 @@ class Tag(PageElement): self.prefix = prefix if attrs is None: attrs = {} - elif attrs and builder.cdata_list_attributes: - attrs = builder._replace_cdata_list_attribute_values( - self.name, attrs) + elif attrs: + if builder is not None and builder.cdata_list_attributes: + attrs = builder._replace_cdata_list_attribute_values( + self.name, attrs) + else: + attrs = dict(attrs) else: attrs = dict(attrs) self.attrs = attrs |