Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ycai
simbricks
Commits
530eac0c
Commit
530eac0c
authored
Jul 24, 2022
by
Jonas Kaufmann
Committed by
Antoine Kaufmann
Jul 29, 2022
Browse files
run.py: throw exceptions instead of working with None
parent
cbd825e1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
experiments/run.py
experiments/run.py
+7
-0
No files found.
experiments/run.py
View file @
530eac0c
...
@@ -308,8 +308,15 @@ if not args.pickled:
...
@@ -308,8 +308,15 @@ if not args.pickled:
for
path
in
args
.
experiments
:
for
path
in
args
.
experiments
:
modname
,
_
=
os
.
path
.
splitext
(
os
.
path
.
basename
(
path
))
modname
,
_
=
os
.
path
.
splitext
(
os
.
path
.
basename
(
path
))
class
ExperimentModuleLoadError
(
Exception
):
pass
spec
=
importlib
.
util
.
spec_from_file_location
(
modname
,
path
)
spec
=
importlib
.
util
.
spec_from_file_location
(
modname
,
path
)
if
spec
is
None
:
raise
ExperimentModuleLoadError
(
'spec is None'
)
mod
=
importlib
.
util
.
module_from_spec
(
spec
)
mod
=
importlib
.
util
.
module_from_spec
(
spec
)
if
spec
.
loader
is
None
:
raise
ExperimentModuleLoadError
(
'spec.loader is None'
)
spec
.
loader
.
exec_module
(
mod
)
spec
.
loader
.
exec_module
(
mod
)
experiments
+=
mod
.
experiments
experiments
+=
mod
.
experiments
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment