Skip to content

Commit 4bdd88b

Browse files
committed
Close the maps handle explicitly
1 parent b142f56 commit 4bdd88b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎realsense2_camera/test/conftest.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ def librealsense_path():
2525
'''
2626
try:
2727
ctypes.CDLL('librealsense2.so')
28-
return next(l.split()[-1] for l in open('/proc/self/maps') if 'librealsense2.so' in l)
28+
with open('/proc/self/maps') as maps:
29+
return next(l.split()[-1] for l in maps if 'librealsense2.so' in l)
2930
except Exception:
3031
pass
3132
libs = [lib for d in os.environ.get('LD_LIBRARY_PATH', '').split(':') if d

0 commit comments

Comments
 (0)