Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #25215

Re: adding a simulation mode

References <CAF_E5JbFK4ZYsvwdVHxw-S7vLkpwskF=OCohWW2okmPi56ObOA@mail.gmail.com> <87liiyr48f.fsf@handshake.de> <CAF_E5JaUD-AyudMut00Bjjan0Zv767do=XM_zKS3DvBmC4reyQ@mail.gmail.com>
Date 2012-07-12 14:20 +0100
Subject Re: adding a simulation mode
From andrea crotti <andrea.crotti.0@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.2039.1342099220.4697.python-list@python.org> (permalink)

Show all headers | View raw


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?

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: adding a simulation mode andrea crotti <andrea.crotti.0@gmail.com> - 2012-07-12 14:20 +0100
  Re: adding a simulation mode John Gordon <gordon@panix.com> - 2012-07-12 13:56 +0000
    Re: adding a simulation mode andrea crotti <andrea.crotti.0@gmail.com> - 2012-07-12 15:17 +0100
      Re: adding a simulation mode John Gordon <gordon@panix.com> - 2012-07-12 15:10 +0000
        Re: adding a simulation mode andrea crotti <andrea.crotti.0@gmail.com> - 2012-07-12 16:37 +0100
          Re: adding a simulation mode Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-07-13 02:16 +0000
            Re: adding a simulation mode Hans Mulder <hansmu@xs4all.nl> - 2012-07-13 18:33 +0200
              RE: adding a simulation mode "Prasad, Ramit" <ramit.prasad@jpmorgan.com> - 2012-07-13 17:08 +0000
              Re: adding a simulation mode Chris Angelico <rosuav@gmail.com> - 2012-07-14 03:24 +1000
      Re: adding a simulation mode Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-07-13 02:09 +0000
  Re: adding a simulation mode Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-07-13 02:37 +0000
    Re: adding a simulation mode andrea crotti <andrea.crotti.0@gmail.com> - 2012-07-13 09:54 +0100

csiph-web