Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Remove the isstring hack in lxml treewalker#118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
gsnedders merged 1 commit intohtml5lib:masterfromgsnedders:isstring_be_gone
Nov 2, 2013
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletionshtml5lib/treewalkers/lxmletree.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -87,10 +87,6 @@ def __init__(self, fragment_root, obj):
self.tail = ensure_str(self.obj.tail)
else:
self.tail = None
self.isstring = isinstance(obj, str) or isinstance(obj, bytes)
# Support for bytes here is Py2
if self.isstring:
self.obj = ensure_str(self.obj)

def __getattr__(self, name):
return getattr(self.obj, name)
Expand DownExpand Up@@ -143,7 +139,7 @@ def getNodeDetails(self, node):
elif isinstance(node, Doctype):
return _base.DOCTYPE, node.name, node.public_id, node.system_id

elif isinstance(node, FragmentWrapper) and node.isstring:
elif isinstance(node, FragmentWrapper) andnot hasattr(node, "tag"):
return _base.TEXT, node.obj

elif node.tag == etree.Comment:
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp