replace md5 with sha256 (#2905)
MD5 is unavailable on systems with active FIPS mode. That makes black crash when run on such systems.
This commit is contained in:
parent
147526451a
commit
67eaf24665
@ -25,6 +25,7 @@
|
|||||||
- Do not format `__pypackages__` directories by default (#2836)
|
- Do not format `__pypackages__` directories by default (#2836)
|
||||||
- Add support for specifying stable version with `--required-version` (#2832).
|
- Add support for specifying stable version with `--required-version` (#2832).
|
||||||
- Avoid crashing when the user has no homedir (#2814)
|
- Avoid crashing when the user has no homedir (#2814)
|
||||||
|
- Avoid crashing when md5 is not available (#2905)
|
||||||
|
|
||||||
### Documentation
|
### Documentation
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
chosen by the user.
|
chosen by the user.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from hashlib import md5
|
from hashlib import sha256
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
@ -182,6 +182,6 @@ def get_cache_key(self) -> str:
|
|||||||
str(int(self.magic_trailing_comma)),
|
str(int(self.magic_trailing_comma)),
|
||||||
str(int(self.experimental_string_processing)),
|
str(int(self.experimental_string_processing)),
|
||||||
str(int(self.preview)),
|
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)
|
return ".".join(parts)
|
||||||
|
Loading…
Reference in New Issue
Block a user