Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'that?': 0.05; 'subject:code': 0.07; 'try:': 0.09; 'cc:addr:python-list': 0.11; 'def': 0.12; "wouldn't": 0.14; '24,': 0.16; 'did:': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'middleware': 0.16; 'roy': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'work,': 0.20; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; '[2]': 0.30; 'dec': 0.30; 'mode': 0.30; 'message-id:@mail.gmail.com': 0.30; 'assert': 0.31; 'option': 0.32; 'run': 0.32; "can't": 0.35; 'except': 0.35; 'case,': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'add': 0.35; 'false': 0.36; 'fact': 0.38; 'aside': 0.39; 'smith': 0.68; 'to:none': 0.92; 'imagine': 0.93; 'refuse': 0.93; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=2a4/6yQiG0ntK2WnknNLRP4JF91t7pGQZA6pJTcUBto=; b=O0NwDZlJZp8mEnah2DTWm/IKswR1KCkbktXiFQ4gddd69LyHV6MAlBGaTGA/UC3Vil yBJubXMjrQan/pAHWP6cCrcgexrh3IcoKA+nDsuUsN+YpWlGtoDesbIM5VM3AUD4RRmv fUjdLV5y0ZPWcpRvF3lIToiljIjaz2rv+0XQ1DQ5Zd47i+ksandDaarc6xXvl0vejMsh h4CqJ8sMUFOW6BtMFbn9qqdVUtU2pyElfcNs9AjcuvG11DSSUV8/9Y9nTMS6y7mpeB1/ euudim1Do48sHNpBb25UryHKGe1tTI6TX2TsUOP0lybUt54pwhRJmUBrfjlAtftJwAT0 ltSw== MIME-Version: 1.0 X-Received: by 10.68.196.193 with SMTP id io1mr27909324pbc.46.1387825964438; Mon, 23 Dec 2013 11:12:44 -0800 (PST) In-Reply-To: References: <52b782db$0$6599$c3e8da3$5496439d@news.astraweb.com> <52b7a0e4$0$29994$c3e8da3$5496439d@news.astraweb.com> <52b86d53$0$29991$c3e8da3$5496439d@news.astraweb.com> Date: Tue, 24 Dec 2013 06:12:44 +1100 Subject: Re: cascading python executions only if return code is 0 From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 20 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1387825974 news.xs4all.nl 2897 [2001:888:2000:d::a6]:51609 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:62649 On Tue, Dec 24, 2013 at 6:03 AM, Roy Smith wrote: > [2] In which case, we would just add some middleware which did: > > assert "-O" not in sys.argv Aside from the fact that this wouldn't work, it won't work :) By the time you see argv, the -O option has been eaten. But why stop at that? def assertions_working(): try: assert False except AssertionError: return True return False assert assertions_working() # refuse to run in -O mode Can't imagine why that wouldn't work...... ChrisA