From a5c6e9a89242bb42dbc98f29681d2f74aec12b02 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Mon, 23 Mar 2015 19:23:43 -0500 Subject: use kwargs for BasicConstraints creation Also check path_length using integer_types --- src/cryptography/x509.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/cryptography/x509.py b/src/cryptography/x509.py index 0c773dac..43ece920 100644 --- a/src/cryptography/x509.py +++ b/src/cryptography/x509.py @@ -176,8 +176,11 @@ class BasicConstraints(object): if path_length is not None and not ca: raise ValueError("path_length must be None when ca is False") - if path_length is not None and (not isinstance(path_length, int) - or path_length < 0): + if ( + path_length is not None and (not isinstance( + path_length, six.integer_types + ) or path_length < 0) + ): raise TypeError( "path_length must be a non-negative integer or None" ) -- cgit v1.2.3