Skip to content

Commit 970f204

Browse files
sveinseacolomb
andauthored
Use getattr instead of hasattr
Co-authored-by: André Colomb <[email protected]>
1 parent d043743 commit 970f204

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

canopen/sdo/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,7 @@ def close(self):
786786
if self.closed:
787787
return
788788
super(BlockDownloadStream, self).close()
789-
if not hasattr(self, "_initialized"):
789+
if not getattr(self, "_initialized", False):
790790
# Don't do finalization if initialization was not successful
791791
return
792792
if not self._done:

0 commit comments

Comments
 (0)