diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-10-02 23:00:39 +0200 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-10-02 23:00:39 +0200 |
commit | 6661d885a34b355200b8ee6bd559af0a5cfc9c8b (patch) | |
tree | c0f0f5a78f983875d4320d62ada74fee9ce62644 /Lib | |
parent | Merge from 3.5 (diff) | |
download | cpython-6661d885a34b355200b8ee6bd559af0a5cfc9c8b.tar.gz cpython-6661d885a34b355200b8ee6bd559af0a5cfc9c8b.tar.bz2 cpython-6661d885a34b355200b8ee6bd559af0a5cfc9c8b.zip |
Issue #25287: Don't add crypt.METHOD_CRYPT to crypt.methods if it's not
supported. Check if it is supported, it may not be supported on OpenBSD for
example.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/crypt.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/crypt.py b/Lib/crypt.py index 49ab96e1400..fbc5f4cc355 100644 --- a/Lib/crypt.py +++ b/Lib/crypt.py @@ -54,9 +54,8 @@ METHOD_SHA256 = _Method('SHA256', '5', 16, 63) METHOD_SHA512 = _Method('SHA512', '6', 16, 106) methods = [] -for _method in (METHOD_SHA512, METHOD_SHA256, METHOD_MD5): +for _method in (METHOD_SHA512, METHOD_SHA256, METHOD_MD5, METHOD_CRYPT): _result = crypt('', _method) if _result and len(_result) == _method.total_size: methods.append(_method) -methods.append(METHOD_CRYPT) del _result, _method |