Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Althviz Moré <d.althviz10@uniandes.edu.co>
  • Loading branch information
maurerle and dalthviz committed Nov 21, 2022
1 parent 3809a2b commit 29d676c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions spyder/plugins/editor/widgets/gotoline.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def __init__(self, editor):
ok_button = bbox.button(QDialogButtonBox.Ok)
ok_button.setEnabled(False)
# QIntValidator does not handle '+' sign
# See Spyder PR #20070
# See spyder-ide/spyder#20070
self.lineedit.textChanged.connect(
lambda text: ok_button.setEnabled(len(text) > 0 and text != '+'))

Expand All @@ -79,7 +79,7 @@ def text_has_changed(self, text):
text = str(text)

# QIntValidator does not handle '+' sign
# See Spyder PR #20070
# See spyder-ide/spyder#12693
if text and text != '+':
self.lineno = int(text)
else:
Expand Down
3 changes: 2 additions & 1 deletion spyder/plugins/editor/widgets/tests/test_gotoline.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
"""Tests for gotoline.py"""

# Third party imports
from qtpy.QtWidgets import QDialogButtonBox, QPushButton, QTableWidget, QLineEdit
from qtpy.QtWidgets import QDialogButtonBox, QLineEdit

# Local imports
from spyder.plugins.editor.widgets.gotoline import GoToLineDialog


def test_gotolinedialog_has_cancel_button(codeeditor, qtbot, tmpdir):
"""
Test that GoToLineDialog has a Cancel button.
Expand Down
2 changes: 1 addition & 1 deletion spyder/plugins/variableexplorer/widgets/importwizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def get_skiprows(self):
"""Return number of lines to be skipped"""
skip_rows = to_text_string(self.skiprows_edt.text())
# QIntValidator does not handle '+' sign
# See Spyder PR #20070
# See spyder-ide/spyder#20070
if skip_rows and skip_rows != '+':
return int(skip_rows)
else:
Expand Down

0 comments on commit 29d676c

Please sign in to comment.