Skip to content

Commit a559d66

Browse files
committed
Having __exit__ method without __enter__ does not make sense
See https://www.python.org/dev/peps/pep-0343/ The cached file handles should be closed by the default destructor anyway.
1 parent 5972219 commit a559d66

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

ev3dev/ev3dev.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,6 @@ def __matches(self, attribute, pattern):
8282
value = self._get_attribute(attribute)
8383
return any([value.find(pat) >= 0 for pat in list(pattern)])
8484

85-
def __exit__(self, exc_type, exc_value, traceback):
86-
print("Well, this is embarassing....")
87-
for f in self.filehandle_cache:
88-
print(f)
89-
f.close()
90-
9185
def __attribute_file( self, attribute, mode, reopen=False ):
9286
"""Manages the file handle cache and opening the files in the correct mode"""
9387

0 commit comments

Comments
 (0)