<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>hira98</author_name>
  <author_url>https://blog.hatena.ne.jp/hira98/</author_url>
  <blog_title>会社辞めてニートになった元プログラマーの雑記帳</blog_title>
  <blog_url>https://hira98.hatenablog.com/</blog_url>
  <categories>
  </categories>
  <description>【結論】 sys.exit()はプログラムを強制終了しているわけではなく、BaseException例外を投げているだけ。 よって、tryブロックでsys.exit()を呼ぶと強制終了しない。 os._exit()を呼べばtryブロックでも強制終了できるが一般的な書き方ではない。 【目次】 はじめに サンプルソース 実行結果 参考情報 さいごに はじめに 結論に書いた内容が全てなので、補足説明は特にありません😅 なので、結論に書いた内容が正しいことの確証を得るために試したサンプルコードと結果だけを載せています。 サンプルソース import sys import os def test(n):…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fhira98.hatenablog.com%2Fentry%2F2019%2F07%2F02%2F210000&quot; title=&quot;【Python】sys.exit()は例外を投げているだけ - 会社辞めてニートになった元プログラマーの雑記帳&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://cdn-ak.f.st-hatena.com/images/fotolife/h/hira98/20190630/20190630161737.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2019-07-02 21:00:00</published>
  <title>【Python】sys.exit()は例外を投げているだけ</title>
  <type>rich</type>
  <url>https://hira98.hatenablog.com/entry/2019/07/02/210000</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
