49def check_file_subproc(path):
50
51 from subprocess import Popen, PIPE
52 import time
53 time.sleep(5)
54
55 p = Popen(['python', "-c", "from TrigValTools.TrigRootUtils import check_file; check_file('{}')".format(path)], stdout=PIPE, stderr=PIPE)
56
57 stdout, stderr = p.communicate()
58 rc = p.returncode
59 time.sleep(5)
60
61 if "error" in stdout.decode('utf-8').lower() or "error" in stderr.decode('utf-8').lower():
62 rc = 1
63 log.error('ERROR: Detected errors when opening root file')
64
65 log.error(stdout.decode('utf-8'))
66 log.error(stderr.decode('utf-8'))
67 return rc