Skip to content

Commit

Permalink
replace md5 with sha256
Browse files Browse the repository at this point in the history
MD5 is unavailable on systems with active FIPS mode. That makes black
crash when run on such systems.
  • Loading branch information
tomjelinek committed Mar 3, 2022
1 parent 1475264 commit e53a6bc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/black/mode.py
Expand Up @@ -4,7 +4,7 @@
chosen by the user.
"""

from hashlib import md5
from hashlib import sha256
import sys

from dataclasses import dataclass, field
Expand Down Expand Up @@ -182,6 +182,6 @@ def get_cache_key(self) -> str:
str(int(self.magic_trailing_comma)),
str(int(self.experimental_string_processing)),
str(int(self.preview)),
md5((",".join(sorted(self.python_cell_magics))).encode()).hexdigest(),
sha256((",".join(sorted(self.python_cell_magics))).encode()).hexdigest(),
]
return ".".join(parts)

0 comments on commit e53a6bc

Please sign in to comment.