Skip to content

Commit

Permalink
Replace logger.warn with logger.warning
Browse files Browse the repository at this point in the history
  • Loading branch information
tdg5 committed Apr 7, 2024
1 parent 6c330f8 commit 2dbcc5a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion reqless/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def import_class(class_name: str) -> Type:
if Importer._loaded[class_name] < mtime:
mod = importlib.reload(mod)
except OSError:
logger.warn("Could not check modification time of %s", mod.__file__)
logger.warning("Could not check modification time of %s", mod.__file__)

_class: Type = getattr(mod, class_name.rpartition(".")[2])
return _class
2 changes: 1 addition & 1 deletion reqless/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ def fail(self, group: str, message: str) -> Union[bool, str]:
that job will fail. Failed jobs are kept until they are canceled or
completed. __Returns__ the id of the failed job if successful, or
`False` on failure."""
logger.warn("Failing %s (%s): %s", self.jid, group, message)
logger.warning("Failing %s (%s): %s", self.jid, group, message)
response: bool = self.client(
"fail",
self.jid,
Expand Down
6 changes: 3 additions & 3 deletions reqless/workers/forking.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def __init__(
def stop(self, sig: int = signal.SIGINT) -> None:
"""Stop all the workers, and then wait for them"""
for cpid in self.sandboxes:
logger.warn("Stopping %i..." % cpid)
logger.warning("Stopping %i..." % cpid)
try:
os.kill(cpid, sig)
except OSError: # pragma: no cover
Expand All @@ -67,7 +67,7 @@ def stop(self, sig: int = signal.SIGINT) -> None:
try:
logger.info("Waiting for %i..." % cpid)
pid, status = os.waitpid(cpid, 0)
logger.warn("%i stopped with status %i" % (pid, status >> 8))
logger.warning("%i stopped with status %i" % (pid, status >> 8))
except OSError: # pragma: no cover
logger.exception("Error waiting for %i..." % cpid)
finally:
Expand Down Expand Up @@ -108,7 +108,7 @@ def run(self) -> None:
try:
while not self.shutdown:
pid, status = os.wait()
logger.warn(
logger.warning(
"Worker %i died with status %i from signal %i"
% (pid, status >> 8, status & 0xFF)
)
Expand Down
2 changes: 1 addition & 1 deletion reqless/workers/greenlet.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def kill(self, jid: str) -> None:
"""Stop the greenlet processing the provided jid"""
greenlet = self.greenlets.get(jid)
if greenlet is not None:
logger.warn("Lost ownership of %s" % jid)
logger.warning("Lost ownership of %s" % jid)
greenlet.kill()

def run(self) -> None:
Expand Down
2 changes: 1 addition & 1 deletion reqless/workers/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def handler(
message = "".join(traceback.format_stack(frame))
message = "Signaled traceback for %s:\n%s" % (os.getpid(), message)
print(message, file=sys.stderr)
logger.warn(message)
logger.warning(message)
elif signum == signal.SIGUSR2:
# USR2 - Enter a debugger
# Much thanks to http://stackoverflow.com/questions/132058
Expand Down

0 comments on commit 2dbcc5a

Please sign in to comment.