mirror of
https://github.com/certbot/certbot.git
synced 2026-06-03 22:08:07 -04:00
use hasattr
This commit is contained in:
parent
25605a15a4
commit
3b4551e5b1
1 changed files with 3 additions and 4 deletions
|
|
@ -608,11 +608,10 @@ class BackwardsCompatibleClientV2(object):
|
|||
return self.client.new_account(regr)
|
||||
|
||||
def _acme_version_from_directory(self, directory):
|
||||
try:
|
||||
nonce_field = directory['newNonce'] # pylint: disable=unused-variable
|
||||
except KeyError:
|
||||
if hasattr(directory, 'newNonce'):
|
||||
return 2
|
||||
else:
|
||||
return 1
|
||||
return 2
|
||||
|
||||
|
||||
class ClientNetwork(object): # pylint: disable=too-many-instance-attributes
|
||||
|
|
|
|||
Loading…
Reference in a new issue