Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!news-out.readnews.com!news-xxxfer.readnews.com!panix!gordon From: John Gordon Newsgroups: comp.lang.python Subject: Re: adding a simulation mode Date: Thu, 12 Jul 2012 13:56:56 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 27 Message-ID: References: <87liiyr48f.fsf@handshake.de> NNTP-Posting-Host: panix1.panix.com X-Trace: reader1.panix.com 1342101416 11747 166.84.1.1 (12 Jul 2012 13:56:56 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Thu, 12 Jul 2012 13:56:56 +0000 (UTC) User-Agent: nn/6.7.3 Xref: csiph.com comp.lang.python:25218 In andrea crotti writes: > 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? copytree() could contain a call to sys.exit(), although that seems like a rude thing to do. -- John Gordon A is for Amy, who fell down the stairs gordon@panix.com B is for Basil, assaulted by bears -- Edward Gorey, "The Gashlycrumb Tinies"