Skip to content

Commit

Permalink
Minor code cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
scoder committed Dec 29, 2023
1 parent bd6d8db commit 1614883
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions src/lxml/extensions.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -534,10 +534,7 @@ cdef class _ExsltRegExp:
flags = self._make_string(flags)
s = self._make_string(s)
rexpc = self._compile(rexp, 'i' in flags)
if 'g' in flags:
count = 0
else:
count = 1
count: object = 0 if 'g' in flags else 1
return rexpc.sub(replacement, s, count)

cdef _register_in_context(self, _BaseContext context):
Expand Down
2 changes: 1 addition & 1 deletion src/lxml/readonlytree.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ cdef class _ReadOnlyProxy:
c_node = c_node.next
return c

def __nonzero__(self):
def __bool__(self):
cdef xmlNode* c_node
self._assertNode()
c_node = _findChildBackwards(self._c_node, 0)
Expand Down

0 comments on commit 1614883

Please sign in to comment.