checking attribute existance before referencing it
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@478 96b47cad-a561-4643-ad3b-153ac7d7599c
This commit is contained in:
@@ -476,9 +476,9 @@ class DF(File): # {{{
|
||||
|
||||
for i in indexes:
|
||||
file = self.content[i]
|
||||
if ((hasattr(file, attribute) and getattr(file, attribute)==value)
|
||||
if (hasattr(file, attribute) and ((getattr(file, attribute)==value)
|
||||
or (attribute == 'dfname' and getattr(file,
|
||||
attribute).startswith(value))):
|
||||
attribute).startswith(value)))):
|
||||
return file
|
||||
# not found
|
||||
if isinstance(value, int):
|
||||
|
||||
Reference in New Issue
Block a user