Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'exception': 0.03; 'anyway.': 0.04; 'differently': 0.07; 'subject:adding': 0.07; 'try:': 0.07; 'idea?': 0.09; 'cc:addr:python-list': 0.10; 'looked': 0.10; 'copytree': 0.16; 'quit.': 0.16; 'quits': 0.16; 'cc:2**0': 0.23; 'example': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'message-id:@mail.gmail.com': 0.27; 'code': 0.31; "can't": 0.34; 'received:google.com': 0.34; 'received:209.85': 0.35; 'except': 0.36; 'but': 0.36; 'why': 0.37; 'quite': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'from:': 0.38; 'some': 0.38; 'header:Received:5': 0.40; 'subject:mode': 0.84 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:to :cc:content-type; bh=xrXnHdB07UqbfYtTJPaTI984t9u9+uUCGkLnEmPpvwk=; b=ivtGbrCMZdMMskMrmbJ/TRKDfUiJ69kQuOqTMqKbasOOmbjVA+178wBeA5u3FbU5QI mEq18gKQxjjpBkh/vUeyaBt0TNvtk7TtqWrCBKhCxEyA0rBH72rfsDPWGBeEUxOnVZw7 rOnyfqNBUPMe41j5oiiiunsmy6cTPIokIyimJR9RE1lsDTH4XgLur4J9+xOy0yRI1+pW FGnT7Wls9WGqnPB/4kl2/bzB03t3l2W2vxdgWA79UBJluZM88evi3QV/gtFFLMMi+mpU jhTRMwnpT3e5dFyy9NoCMLr37H9Mhlbrw8mYAzy5RFpyzapM10sRX8KHG56gT249603n UqFw== MIME-Version: 1.0 In-Reply-To: References: <87liiyr48f.fsf@handshake.de> Date: Thu, 12 Jul 2012 14:20:18 +0100 Subject: Re: adding a simulation mode From: andrea crotti To: Dieter Maurer Content-Type: text/plain; charset=ISO-8859-1 Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 21 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1342099220 news.xs4all.nl 6932 [2001:888:2000:d::a6]:48759 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:25215 One thing that I don't quite understand is why some calls even if I catch the exception still makes the whole program quit. For example this try: copytree('sjkdf', 'dsflkj') Popen(['notfouhd'], shell=True) except Exception as e: print("here") behaves differently from: try: Popen(['notfouhd'], shell=True) copytree('sjkdf', 'dsflkj') except Exception as e: print("here") because if copytree fails it quits anyway. I also looked at the code but can't quite get why.. any idea?