Remove invalid escape sequences

A recent style update to Python 3.6 adds deprecation W605, which
tightens the usage of invalid escape sequences. This patch removes
any instances of invalid escape sequences from the PyKMIP code
base, bringing the library back up to compliance with Python style.
This commit is contained in:
Peter Hamilton 2018-11-15 13:53:06 -05:00
parent 0819574424
commit 8abe3de8cb
3 changed files with 3 additions and 3 deletions

View File

@ -41,7 +41,7 @@ if __name__ == '__main__':
protocol_versions = list() protocol_versions = list()
if opts.protocol_versions is not None: if opts.protocol_versions is not None:
for version in re.split(',| ', opts.protocol_versions): for version in re.split(',| ', opts.protocol_versions):
mm = re.split('\.', version) mm = re.split(r'\.', version)
protocol_versions.append(ProtocolVersion(int(mm[0]), int(mm[1]))) protocol_versions.append(ProtocolVersion(int(mm[0]), int(mm[1])))
# Build the client and connect to the server # Build the client and connect to the server

View File

@ -1444,7 +1444,7 @@ class KmipEngine(object):
else: else:
raise exceptions.InvalidField( raise exceptions.InvalidField(
"The cryptographic length must correspond to a valid " "The cryptographic length must correspond to a valid "
"number of bytes (i.e., it must be a multiple of 8)." "number of bytes; it must be a multiple of 8."
) )
else: else:
raise exceptions.InvalidField( raise exceptions.InvalidField(

View File

@ -4108,7 +4108,7 @@ class TestKmipEngine(testtools.TestCase):
self.assertRaisesRegexp( self.assertRaisesRegexp(
exceptions.InvalidField, exceptions.InvalidField,
"The cryptographic length must correspond to a valid number of " "The cryptographic length must correspond to a valid number of "
"bytes \(i.e., it must be a multiple of 8\).", "bytes; it must be a multiple of 8.",
e._process_derive_key, e._process_derive_key,
*args *args
) )