Skip to content
Snippets Groups Projects
Commit 83948d31 authored by Peterson, Peter's avatar Peterson, Peter
Browse files

Check for ui file existence and report errror

Refs #23762
parent 7b2040d9
No related branches found
No related tags found
No related merge requests found
......@@ -77,6 +77,10 @@ def load_ui(caller_filename, ui_relfilename, baseinstance=None):
return the form class
"""
filepath = osp.join(osp.dirname(caller_filename), ui_relfilename)
if not osp.exists(filepath):
raise ImportError('File "{}" does not exist'.format(filepath))
if not osp.isfile(filepath):
raise ImportError('File "{}" is not a file'.format(filepath))
if baseinstance is not None:
return loadUi(filepath, baseinstance=baseinstance)
else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment