Skip to content

Commit

Permalink
Fix some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Python-in-China committed Dec 17, 2024
1 parent 613c88f commit ee0bdc3
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions cyaron/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,8 @@
from typing import List, Optional, cast, Any, Dict, Iterable, Tuple, Union

__all__ = [
"ati",
"list_like",
"int_like",
"strtolines",
"make_unicode",
"unpack_kwargs",
"get_seed_from_argv",
"set_seed_from_argv"
"ati", "list_like", "int_like", "strtolines", "make_unicode",
"unpack_kwargs", "get_seed_from_argv", "set_seed_from_argv"
]


Expand All @@ -35,7 +29,7 @@ def strtolines(string: str):
and remove any blank lines at the end of the the string.
"""
lines = string.split("\n")
for i in range(len(lines)):
for i, _ in enumerate(lines):
lines[i] = lines[i].rstrip()

while len(lines) > 0 and len(lines[-1]) == 0:
Expand Down Expand Up @@ -67,7 +61,7 @@ def unpack_kwargs(
except KeyError:
raise TypeError(
f"{funcname}() missing 1 required keyword-only argument: '{tp}'"
)
) from None
if kwargs:
raise TypeError(
f"{funcname}() got an unexpected keyword argument '{next(iter(kwargs.items()))[0]}'"
Expand Down

0 comments on commit ee0bdc3

Please sign in to comment.