18
18
from builtins import str , bytes
19
19
from packaging .version import Version
20
20
21
- from ...utils .misc import is_container
22
21
from ...utils .filemanip import md5 , hash_infile , hash_timestamp , to_str
23
22
from .traits_extension import (
24
23
traits ,
@@ -157,7 +156,10 @@ def get(self, **kwargs):
157
156
Augments the trait get function to return a dictionary without
158
157
notification handles
159
158
"""
160
- out = super (BaseTraitedSpec , self ).get (** kwargs )
159
+ try :
160
+ out = super (BaseTraitedSpec , self ).trait_get (** kwargs )
161
+ except AttributeError : # deprecated old get
162
+ out = super (BaseTraitedSpec , self ).get (** kwargs )
161
163
out = self ._clean_container (out , Undefined )
162
164
return out
163
165
@@ -183,8 +185,8 @@ def _clean_container(self, objekt, undefinedval=None, skipundefined=False):
183
185
else :
184
186
if not skipundefined :
185
187
out [key ] = undefinedval
186
- elif (isinstance (objekt , TraitListObject ) or isinstance (objekt , list )
187
- or isinstance (objekt , tuple )):
188
+ elif (isinstance (objekt , TraitListObject ) or isinstance (objekt , list ) or
189
+ isinstance (objekt , tuple )):
188
190
out = []
189
191
for val in objekt :
190
192
if isdefined (val ):
@@ -241,8 +243,8 @@ def get_hashval(self, hash_method=None):
241
243
# skip undefined traits and traits with nohash=True
242
244
continue
243
245
244
- hash_files = (not self .has_metadata (name , "hash_files" , False )
245
- and not self .has_metadata (name , "name_source" ))
246
+ hash_files = (not self .has_metadata (name , "hash_files" , False ) and
247
+ not self .has_metadata (name , "name_source" ))
246
248
list_nofilename .append ((name ,
247
249
self ._get_sorteddict (
248
250
val ,
@@ -286,8 +288,8 @@ def _get_sorteddict(self,
286
288
else :
287
289
out = None
288
290
if isdefined (objekt ):
289
- if (hash_files and isinstance (objekt , (str , bytes ))
290
- and os .path .isfile (objekt )):
291
+ if (hash_files and isinstance (objekt , (str , bytes )) and
292
+ os .path .isfile (objekt )):
291
293
if hash_method is None :
292
294
hash_method = config .get ('execution' , 'hash_method' )
293
295
0 commit comments