Skip to content

Commit 8df91eb

Browse files
authored
Merge pull request #14 from benjyw/no_action
Guard against missing action attr.
2 parents 2263fd1 + 8dd7b99 commit 8df91eb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/python/pypi_cleanup/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ def __init__(self, target, contains_input=None):
4444
def handle_starttag(self, tag, attrs):
4545
if tag == "form":
4646
attrs = dict(attrs)
47-
if attrs["action"] == self._target or attrs["action"].startswith(self._target):
47+
action = attrs.get("action") # Might be None.
48+
if action and (action == self._target or action.startswith(self._target)):
4849
self._in_form = True
4950
return
5051

0 commit comments

Comments
 (0)