From 03e755b91f213f0e5eaf8e79f21cfa1a47d5fb81 Mon Sep 17 00:00:00 2001 From: chrys87 Date: Wed, 23 May 2018 15:49:08 +0200 Subject: [PATCH] close filehandle --- src/fenrirscreenreader/inputDriver/evdevDriver.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/fenrirscreenreader/inputDriver/evdevDriver.py b/src/fenrirscreenreader/inputDriver/evdevDriver.py index 54ca4809..6aa5a6b5 100644 --- a/src/fenrirscreenreader/inputDriver/evdevDriver.py +++ b/src/fenrirscreenreader/inputDriver/evdevDriver.py @@ -182,7 +182,8 @@ class driver(inputDriver): continue self.env['runtime']['debug'].writeDebugOut('open(deviceFile)',debug.debugLevel.ERROR) try: - open(deviceFile) + with open(deviceFile) as f: + pass except Exception as e: self.env['runtime']['debug'].writeDebugOut("Not readable Inputdevice : " + deviceFile +' ' + str(e),debug.debugLevel.ERROR) continue