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


Groups > comp.lang.python > #106906 > unrolled thread

Re: sys.exit(1) vs raise SystemExit vs raise

Started byRandom832 <random832@fastmail.com>
First post2016-04-12 09:10 -0400
Last post2016-04-12 09:10 -0400
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: sys.exit(1) vs raise SystemExit vs raise Random832 <random832@fastmail.com> - 2016-04-12 09:10 -0400

#106906 — Re: sys.exit(1) vs raise SystemExit vs raise

FromRandom832 <random832@fastmail.com>
Date2016-04-12 09:10 -0400
SubjectRe: sys.exit(1) vs raise SystemExit vs raise
Message-ID<mailman.45.1460466627.15650.python-list@python.org>
On Tue, Apr 12, 2016, at 08:50, Ganesh Pal wrote:
> I m on python 2.7 and Linux ,  I have a simple code  need suggestion if 
> I
>  I could replace sys.exit(1) with raise  SystemExit .

No; raise SystemExit is equivalent to sys.exit(0); you would need raise
SystemExit(1) to return 1.

Why do you want to do this, though? What do you think you gain from it?

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web