Skip to content

Commit

Permalink
Fix deprecation caused by pickled "itertools.count()"
Browse files Browse the repository at this point in the history
  • Loading branch information
Delgan committed Sep 11, 2023
1 parent 37a2db2 commit b28978e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions loguru/_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@
import builtins
import contextlib
import functools
import itertools
import logging
import re
import sys
Expand Down Expand Up @@ -182,7 +181,7 @@ def __init__(self):
name: (name, name, level.no, level.icon) for name, level in self.levels.items()
}

self.handlers_count = itertools.count()
self.handlers_count = 0
self.handlers = {}

self.extra = {}
Expand Down Expand Up @@ -778,7 +777,8 @@ def add(
>>> logger.add(stream_object, level="INFO")
"""
with self._core.lock:
handler_id = next(self._core.handlers_count)
handler_id = self._core.handlers_count
self._core.handlers_count += 1

error_interceptor = ErrorInterceptor(catch, handler_id)

Expand Down

0 comments on commit b28978e

Please sign in to comment.