Skip to content

Commit bfe956e

Browse files
committed
MAINT: Remove legacy Python checks in utils.misc._empty_hash
1 parent a365496 commit bfe956e

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

doc/changes/dev/13566.other.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove legacy Python-version compatibility checks in :func:`mne.utils.misc._empty_hash` now that ``usedforsecurity=False`` is always supported, by :newcontrib:`Varun Kasyap Pentamaraju` (:gh:`13566`).

doc/changes/names.inc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@
336336
.. _Tziona NessAiver: https://github.com/TzionaN
337337
.. _user27182: https://github.com/user27182
338338
.. _Valerii Chirkov: https://github.com/vagechirkov
339+
.. _Varun Kasyap Pentamaraju: https://github.com/varunkasyap
339340
.. _Velu Prabhakar Kumaravel: https://github.com/vpKumaravel
340341
.. _Victor Ferat: https://github.com/vferat
341342
.. _Victoria Peterson: https://github.com/vpeterson

mne/utils/misc.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,8 @@ def _identity_function(x):
3232
return x
3333

3434

35-
# TODO: no longer needed when py3.9 is minimum supported version
3635
def _empty_hash(kind="md5"):
37-
func = getattr(hashlib, kind)
38-
if "usedforsecurity" in inspect.signature(func).parameters:
39-
return func(usedforsecurity=False)
40-
else:
41-
return func()
36+
return getattr(hashlib, kind)(usedforsecurity=False)
4237

4338

4439
def _pl(x, non_pl="", pl="s"):

0 commit comments

Comments
 (0)