   ;; honor-block-close-p is non-nil, statements such as return, raise,
   ;; break, continue, and pass force one level of outdenting.
   (save-excursion
+    (beginning-of-line)
     (let* ((bod (py-point 'bod))
 	   (pps (parse-partial-sexp bod (point)))
 	   (boipps (parse-partial-sexp bod (py-point 'boi))))
-      (beginning-of-line)
       (cond
        ;; are we inside a multi-line string or comment?
        ((or (and (nth 3 pps) (nth 3 boipps))

	(re-search-backward py-parse-state-re nil 'move)
	(setq ci (current-indentation))
	(beginning-of-line)
	(save-excursion
	  (setq pps (parse-partial-sexp (point) here)))
	;; make sure we don't land inside a triple-quoted string
	(setq done (or ;(zerop ci)
		       (not (nth 3 pps))
		       (bobp)))
	)
      pps)))

;; if point is at a non-zero nesting level, returns the number of the
;; character that opens the smallest enclosing unclosed list; else
;; returns nil.
(defun py-nesting-level ()
  (let ((status (py-parse-state)) )
    (if (zerop (car status))
	nil				; not in a nest
      (car (cdr status)))))		; char# of open bracket


;; Copyright (C) 1992,1993,1994  Tim Peters

;; Author: 1995-1998 Barry A. Warsaw
;;         1992-1994 Tim Peters
;; Maintainer: python-mode@python.org
;; Created:    Feb 1992
