Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mantidproject
mantid
Commits
e498f9c7
Commit
e498f9c7
authored
4 years ago
by
Joseph Torsney
Browse files
Options
Downloads
Patches
Plain Diff
Change RuntimeError to EOFError re28176
parent
09aacf47
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
qt/applications/workbench/workbench/utils/io.py
+2
-2
2 additions, 2 deletions
qt/applications/workbench/workbench/utils/io.py
qt/applications/workbench/workbench/utils/test/test_io.py
+1
-1
1 addition, 1 deletion
qt/applications/workbench/workbench/utils/test/test_io.py
with
3 additions
and
3 deletions
qt/applications/workbench/workbench/utils/io.py
+
2
−
2
View file @
e498f9c7
...
@@ -11,7 +11,7 @@ from qtpy.QtWidgets import QInputDialog
...
@@ -11,7 +11,7 @@ from qtpy.QtWidgets import QInputDialog
def
input_qinputdialog
(
prompt
:
str
=
""
)
->
str
:
def
input_qinputdialog
(
prompt
:
str
=
""
)
->
str
:
"""
"""
Raises a QInputDialog with a given prompt and returns the user input as a string.
Raises a QInputDialog with a given prompt and returns the user input as a string.
If the user cancels the dialog, a
Runtime
Error is raised.
If the user cancels the dialog, a
n EOF
Error is raised.
Intended to be used to override python
'
s `input` function to be more user friendly.
Intended to be used to override python
'
s `input` function to be more user friendly.
"""
"""
dlg
=
QInputDialog
()
dlg
=
QInputDialog
()
...
@@ -21,4 +21,4 @@ def input_qinputdialog(prompt: str = "") -> str:
...
@@ -21,4 +21,4 @@ def input_qinputdialog(prompt: str = "") -> str:
if
accepted
:
if
accepted
:
return
dlg
.
textValue
()
return
dlg
.
textValue
()
else
:
else
:
raise
Runtime
Error
(
"
User input request cancelled
"
)
raise
EOF
Error
(
"
User input request cancelled
"
)
This diff is collapsed.
Click to expand it.
qt/applications/workbench/workbench/utils/test/test_io.py
+
1
−
1
View file @
e498f9c7
...
@@ -39,4 +39,4 @@ class IOTest(TestCase):
...
@@ -39,4 +39,4 @@ class IOTest(TestCase):
mock_QInputDialog
=
mock_QInputDialogClass
()
mock_QInputDialog
=
mock_QInputDialogClass
()
mock_QInputDialog
.
exec_
.
return_value
=
False
mock_QInputDialog
.
exec_
.
return_value
=
False
self
.
assertRaises
(
Runtime
Error
,
input_qinputdialog
)
self
.
assertRaises
(
EOF
Error
,
input_qinputdialog
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment