From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Bug: If else blocks inside for loop fail in newest version [9.1.14 (9.1.14-1-g4931fc-elpa @ /home/paul/org-mode/lisp/)] Date: Thu, 20 Dec 2018 14:39:14 +0100 Message-ID: <87r2ecxqpp.fsf@nicolasgoaziou.fr> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53141) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZylb-0007CU-C8 for emacs-orgmode@gnu.org; Thu, 20 Dec 2018 08:53:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gZyXn-0006Tn-N6 for emacs-orgmode@gnu.org; Thu, 20 Dec 2018 08:39:22 -0500 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:52203) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gZyXn-0006QC-Fl for emacs-orgmode@gnu.org; Thu, 20 Dec 2018 08:39:19 -0500 In-Reply-To: (Paul Lodder's message of "Wed, 19 Dec 2018 10:21:30 +0000") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Paul Lodder Cc: "emacs-orgmode@gnu.org" Hello, Paul Lodder writes: > If else blocks inside for loops in python cause IndentationError, it > does accept the 'if' and the indented part below the 'if', but from > 'else:' onwards the code is not evaluated anymore because of the > 'unexpected indent'. I added an example code block in which this error > occurs. The list 'odds' only contained even values. > > I fixed it by downgrading to an older release again. > > #+BEGIN_SRC python > even = [] > for i in range(10): > if i % 2 == 0: > even.append(i) > else: > print("here") > even.append(("this should be in the list as well",)) > > even > #+END_SRC FWIW, I cannot reproduce your issue on master branch. Regards, -- Nicolas Goaziou