diff options
author | Chris Rose <offline@offby1.net> | 2018-05-16 11:29:43 -0400 |
---|---|---|
committer | Chris Rose <offline@offby1.net> | 2018-05-16 17:18:50 -0400 |
commit | 543bb00c1e767eeb2c4cb43e8fddde79becf82e2 (patch) | |
tree | 42ec184fbd70baae0949902d332446b0c31d934d | |
parent | d25c3b36977fbe6d281efe7cbc9faa39db50498d (diff) |
Switch to subclassing due to the variance in UserDict behaviour
-rw-r--r-- | paramiko/config.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/paramiko/config.py b/paramiko/config.py index cd5aae90..35a5017d 100644 --- a/paramiko/config.py +++ b/paramiko/config.py @@ -21,7 +21,6 @@ Configuration file (aka ``ssh_config``) support. """ -import collections import fnmatch import os import re @@ -298,7 +297,7 @@ class LazyFqdn(object): return self.fqdn -class SSHConfigDict(collections.UserDict): +class SSHConfigDict(dict): """A dictionary wrapper for ssh host configurations. This class introduces some usage niceties for consumers of SSHConfig, @@ -306,8 +305,9 @@ class SSHConfigDict(collections.UserDict): as_bool(key) and as_int(key) for the current raw string values in SSHConfig""" - def __init__(self, initialdata=None): - super(SSHConfigDict, self).__init__(initialdata) + def __init__(self, *args, **kwargs): + # Hey, guess what? Python 2's userdict is an old-style class! + super(SSHConfigDict, self).__init__(*args, **kwargs) def as_bool(self, key): """Express the key as a boolean value. Variations on 'yes' or boolean values |