Commit 590a820f authored by Juanma Barranquero's avatar Juanma Barranquero
Browse files

Fix bug#21762

* lisp/progmodes/python.el (python-syntax-closing-paren-p): Check with
`eql' instead of `=' to accommodate the case that (syntax-after (point))
returns nil.

* test/automated/python-tests.el (python-indent-inside-paren-7):
New test.
parent 92780954
......@@ -490,8 +490,8 @@ The type returned can be `comment', `string' or `paren'."
(defsubst python-syntax-closing-paren-p ()
"Return non-nil if char after point is a closing paren."
(= (syntax-class (syntax-after (point)))
(syntax-class (string-to-syntax ")"))))
(eql (syntax-class (syntax-after (point)))
(syntax-class (string-to-syntax ")"))))
'python-info-ppss-context #'python-syntax-context "24.3")
......@@ -563,6 +563,14 @@ CHOICES = (('some', 'choice'),
(should (eq (car (python-indent-context)) :inside-paren))
(should (= (python-indent-calculate-indentation) 11))))
(ert-deftest python-indent-inside-paren-7 ()
"Test for Bug#21762."
"import re as myre\nvar = [\n"
(goto-char (point-max))
;; This signals an error if the test fails
(should (eq (car (python-indent-context)) :inside-paren-newline-start))))
(ert-deftest python-indent-after-block-1 ()
"The most simple after-block case that shouldn't fail."
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment