Skip to content

Commit b8f4eee

Browse files
build(deps): bump pep8-naming from 0.11.1 to 0.13.0 (#1457)
1 parent 8926abf commit b8f4eee

File tree

6 files changed

+26
-26
lines changed

6 files changed

+26
-26
lines changed

linter-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ types-certifi
66
types-redis
77
types-setuptools
88
flake8-bugbear==21.4.3
9-
pep8-naming==0.11.1
9+
pep8-naming==0.13.0
1010
pre-commit # local linting

sentry_sdk/_queue.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@
2121
if MYPY:
2222
from typing import Any
2323

24-
__all__ = ["Empty", "Full", "Queue"]
24+
__all__ = ["EmptyError", "FullError", "Queue"]
2525

2626

27-
class Empty(Exception):
27+
class EmptyError(Exception):
2828
"Exception raised by Queue.get(block=0)/get_nowait()."
2929
pass
3030

3131

32-
class Full(Exception):
32+
class FullError(Exception):
3333
"Exception raised by Queue.put(block=0)/put_nowait()."
3434
pass
3535

@@ -134,16 +134,16 @@ def put(self, item, block=True, timeout=None):
134134
If optional args 'block' is true and 'timeout' is None (the default),
135135
block if necessary until a free slot is available. If 'timeout' is
136136
a non-negative number, it blocks at most 'timeout' seconds and raises
137-
the Full exception if no free slot was available within that time.
137+
the FullError exception if no free slot was available within that time.
138138
Otherwise ('block' is false), put an item on the queue if a free slot
139-
is immediately available, else raise the Full exception ('timeout'
139+
is immediately available, else raise the FullError exception ('timeout'
140140
is ignored in that case).
141141
"""
142142
with self.not_full:
143143
if self.maxsize > 0:
144144
if not block:
145145
if self._qsize() >= self.maxsize:
146-
raise Full()
146+
raise FullError()
147147
elif timeout is None:
148148
while self._qsize() >= self.maxsize:
149149
self.not_full.wait()
@@ -154,7 +154,7 @@ def put(self, item, block=True, timeout=None):
154154
while self._qsize() >= self.maxsize:
155155
remaining = endtime - time()
156156
if remaining <= 0.0:
157-
raise Full
157+
raise FullError()
158158
self.not_full.wait(remaining)
159159
self._put(item)
160160
self.unfinished_tasks += 1
@@ -166,15 +166,15 @@ def get(self, block=True, timeout=None):
166166
If optional args 'block' is true and 'timeout' is None (the default),
167167
block if necessary until an item is available. If 'timeout' is
168168
a non-negative number, it blocks at most 'timeout' seconds and raises
169-
the Empty exception if no item was available within that time.
169+
the EmptyError exception if no item was available within that time.
170170
Otherwise ('block' is false), return an item if one is immediately
171-
available, else raise the Empty exception ('timeout' is ignored
171+
available, else raise the EmptyError exception ('timeout' is ignored
172172
in that case).
173173
"""
174174
with self.not_empty:
175175
if not block:
176176
if not self._qsize():
177-
raise Empty()
177+
raise EmptyError()
178178
elif timeout is None:
179179
while not self._qsize():
180180
self.not_empty.wait()
@@ -185,7 +185,7 @@ def get(self, block=True, timeout=None):
185185
while not self._qsize():
186186
remaining = endtime - time()
187187
if remaining <= 0.0:
188-
raise Empty()
188+
raise EmptyError()
189189
self.not_empty.wait(remaining)
190190
item = self._get()
191191
self.not_full.notify()
@@ -195,15 +195,15 @@ def put_nowait(self, item):
195195
"""Put an item into the queue without blocking.
196196
197197
Only enqueue the item if a free slot is immediately available.
198-
Otherwise raise the Full exception.
198+
Otherwise raise the FullError exception.
199199
"""
200200
return self.put(item, block=False)
201201

202202
def get_nowait(self):
203203
"""Remove and return an item from the queue without blocking.
204204
205205
Only get an item if one is immediately available. Otherwise
206-
raise the Empty exception.
206+
raise the EmptyError exception.
207207
"""
208208
return self.get(block=False)
209209

sentry_sdk/integrations/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def setup_integrations(
146146
return integrations
147147

148148

149-
class DidNotEnable(Exception):
149+
class DidNotEnable(Exception): # noqa: N818
150150
"""
151151
The integration could not be enabled due to a trivial user error like
152152
`flask` not being installed for the `FlaskIntegration`.

sentry_sdk/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,7 @@ def transaction_from_function(func):
931931
disable_capture_event = ContextVar("disable_capture_event")
932932

933933

934-
class ServerlessTimeoutWarning(Exception):
934+
class ServerlessTimeoutWarning(Exception): # noqa: N818
935935
"""Raised when a serverless method is about to reach its timeout."""
936936

937937
pass

sentry_sdk/worker.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from time import sleep, time
55
from sentry_sdk._compat import check_thread_support
6-
from sentry_sdk._queue import Queue, Full
6+
from sentry_sdk._queue import Queue, FullError
77
from sentry_sdk.utils import logger
88
from sentry_sdk.consts import DEFAULT_QUEUE_SIZE
99

@@ -81,7 +81,7 @@ def kill(self):
8181
if self._thread:
8282
try:
8383
self._queue.put_nowait(_TERMINATOR)
84-
except Full:
84+
except FullError:
8585
logger.debug("background worker queue full, kill failed")
8686

8787
self._thread = None
@@ -114,7 +114,7 @@ def submit(self, callback):
114114
try:
115115
self._queue.put_nowait(callback)
116116
return True
117-
except Full:
117+
except FullError:
118118
return False
119119

120120
def _target(self):

tests/test_client.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@
3535
from collections.abc import Mapping
3636

3737

38-
class EventCaptured(Exception):
38+
class EventCapturedError(Exception):
3939
pass
4040

4141

4242
class _TestTransport(Transport):
4343
def capture_event(self, event):
44-
raise EventCaptured(event)
44+
raise EventCapturedError(event)
4545

4646

4747
def test_transport_option(monkeypatch):
@@ -273,7 +273,7 @@ def e(exc):
273273

274274
e(ZeroDivisionError())
275275
e(MyDivisionError())
276-
pytest.raises(EventCaptured, lambda: e(ValueError()))
276+
pytest.raises(EventCapturedError, lambda: e(ValueError()))
277277

278278

279279
def test_with_locals_enabled(sentry_init, capture_events):
@@ -400,8 +400,8 @@ def test_attach_stacktrace_disabled(sentry_init, capture_events):
400400

401401
def test_capture_event_works(sentry_init):
402402
sentry_init(transport=_TestTransport())
403-
pytest.raises(EventCaptured, lambda: capture_event({}))
404-
pytest.raises(EventCaptured, lambda: capture_event({}))
403+
pytest.raises(EventCapturedError, lambda: capture_event({}))
404+
pytest.raises(EventCapturedError, lambda: capture_event({}))
405405

406406

407407
@pytest.mark.parametrize("num_messages", [10, 20])
@@ -744,10 +744,10 @@ def test_errno_errors(sentry_init, capture_events):
744744
sentry_init()
745745
events = capture_events()
746746

747-
class Foo(Exception):
747+
class FooError(Exception):
748748
errno = 69
749749

750-
capture_exception(Foo())
750+
capture_exception(FooError())
751751

752752
(event,) = events
753753

0 commit comments

Comments
 (0)