9 raise RuntimeError(
'Please specify tutorial file path as only argument of this script')
12file_path = os.path.expanduser(sys.argv[1])
14if os.path.exists(file_path):
17 module_name =
"__main__"
21 ROOT.gROOT.SetBatch(
True)
24 sys.dont_write_bytecode =
True
27 if sys.version_info >= (3,5):
29 spec = importlib.util.spec_from_file_location(module_name, file_path)
30 module = importlib.util.module_from_spec(spec)
31 sys.modules[module_name] = module
32 spec.loader.exec_module(module)
35 imp.load_module(module_name,
open(file_path,
'r'), file_path, (
'.py',
'r',1))
37 raise RuntimeError(
'Cannot execute test, {} is not a valid tutorial file path'.format(file_path))