Skip to content

Commit aa1456e

Browse files
committed
fix(sentry): fix bug in _chunks and corresponding doctest
1 parent 3476766 commit aa1456e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

fmriprep/utils/sentry.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ def sentry_setup(opts, exec_env):
5353
import psutil
5454
import hashlib
5555
from ..__about__ import __version__
56-
from ..utils.sentry import before_send
56+
5757
environment = "prod"
5858
release = __version__
5959
if not __version__:
6060
environment = "dev"
6161
release = "dev"
62-
elif int(os.getenv('FMRIPREP_DEV', 0)) or ('+' in __version__):
62+
elif int(os.getenv('FMRIPREP_DEV', '0')) or ('+' in __version__):
6363
environment = "dev"
6464

6565
sentry_sdk.init("https://[email protected]/1137693",
@@ -180,9 +180,9 @@ def before_send(event, hints):
180180
msg = event['logentry']['message']
181181
if msg.startswith("could not run node:"):
182182
return None
183-
elif msg.startswith("Saving crash info to "):
183+
if msg.startswith("Saving crash info to "):
184184
return None
185-
elif re.match("Node .+ failed to run on host .+", msg):
185+
if re.match("Node .+ failed to run on host .+", msg):
186186
return None
187187

188188
if 'breadcrumbs' in event and isinstance(event['breadcrumbs'], list):
@@ -201,9 +201,9 @@ def _chunks(string, length=CHUNK_SIZE):
201201
"""
202202
Splits a string into smaller chunks
203203
204-
>>> list(_chunks('some longer string', length=3))
204+
>>> list(_chunks('some longer string.', length=3))
205205
['som', 'e l', 'ong', 'er ', 'str', 'ing', '.']
206206
207207
"""
208-
return (string[i:i + CHUNK_SIZE]
208+
return (string[i:i + length]
209209
for i in range(0, len(string), length))

0 commit comments

Comments
 (0)