Skip to content

Commit

Permalink
pyupgrade --py39-plus
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasWaldmann committed Apr 3, 2024
1 parent dc32887 commit 806c491
Show file tree
Hide file tree
Showing 4 changed files with 220 additions and 223 deletions.
4 changes: 2 additions & 2 deletions emeraldtree/ElementInclude.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def include(elem, loader=None):
node = loader(href, parse)
if node is None:
raise FatalIncludeError(
"cannot load %r as %r" % (href, parse)
"cannot load {!r} as {!r}".format(href, parse)
)
node = copy.copy(node)
if e.tail:
Expand All @@ -119,7 +119,7 @@ def include(elem, loader=None):
text = loader(href, parse, e.get("encoding"))
if text is None:
raise FatalIncludeError(
"cannot load %r as %r" % (href, parse)
"cannot load {!r} as {!r}".format(href, parse)
)
if i:
node = elem[i-1]
Expand Down
6 changes: 2 additions & 4 deletions emeraldtree/ElementPath.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,12 @@ def select(context, result):
def prepare_star(next, token):
def select(context, result):
for elem in result:
for e in elem:
yield e
yield from elem
return select

def prepare_dot(next, token):
def select(context, result):
for elem in result:
yield elem
yield from result
return select

def prepare_iter(next, token):
Expand Down
Loading

0 comments on commit 806c491

Please sign in to comment.