Skip to content

Commit bf3528d

Browse files
authored
Merge pull request #208 from tomato42/long-lines
Fix too long lines
2 parents 69e9735 + e698072 commit bf3528d

File tree

8 files changed

+380
-76
lines changed

8 files changed

+380
-76
lines changed

src/ecdsa/_compat.py

+17
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Common functions for providing cross-python version compatibility.
33
"""
44
import sys
5+
import re
56
from six import integer_types
67

78

@@ -23,6 +24,18 @@ def normalise_bytes(buffer_object):
2324
def hmac_compat(ret):
2425
return ret
2526

27+
if sys.version_info < (2, 7) or sys.version_info < (2, 7, 4):
28+
29+
def remove_whitespace(text):
30+
"""Removes all whitespace from passed in string"""
31+
return re.sub(r"\s+", "", text)
32+
33+
else:
34+
35+
def remove_whitespace(text):
36+
"""Removes all whitespace from passed in string"""
37+
return re.sub(r"\s+", "", text, flags=re.UNICODE)
38+
2639

2740
else:
2841
if sys.version_info < (3, 4):
@@ -41,3 +54,7 @@ def hmac_compat(data):
4154
def normalise_bytes(buffer_object):
4255
"""Cast the input into array of bytes."""
4356
return memoryview(buffer_object).cast("B")
57+
58+
def remove_whitespace(text):
59+
"""Removes all whitespace from passed in string"""
60+
return re.sub(r"\s+", "", text, flags=re.UNICODE)

src/ecdsa/ecdh.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ class NoCurveError(Exception):
2929

3030

3131
class InvalidCurveError(Exception):
32-
"""ECDH. Raised in case the public and private keys use different curves."""
32+
"""
33+
ECDH. Raised in case the public and private keys use different curves.
34+
"""
3335

3436
pass
3537

@@ -174,7 +176,8 @@ def load_private_key_der(self, private_key_der):
174176
Note, the only DER format supported is the RFC5915
175177
Look at keys.py:SigningKey.from_der()
176178
177-
:param private_key_der: string with the DER encoding of private ECDSA key
179+
:param private_key_der: string with the DER encoding of private ECDSA
180+
key
178181
:type private_key_der: string
179182
180183
:raises InvalidCurveError: private_key curve not the same as self.curve

0 commit comments

Comments
 (0)