Browse Source

Exceptions

pull/79/head
Jure Šorn 4 years ago
parent
commit
d86085875b
2 changed files with 4 additions and 4 deletions
  1. 4
      README.md
  2. 4
      index.html

4
README.md

@ -1371,8 +1371,8 @@ finally:
```python ```python
except <exception>: except <exception>:
except <exception> as <name>: except <exception> as <name>:
except (<exception>, ...): except (<exception>, [...]):
except (<exception>, ...) as <name>: except (<exception>, [...]) as <name>:
``` ```
* **Also catches subclasses of the exception.** * **Also catches subclasses of the exception.**
* **Use `'traceback.print_exc()'` to print the error message to stderr.** * **Use `'traceback.print_exc()'` to print the error message to stderr.**

4
index.html

@ -1304,8 +1304,8 @@ LogicOp = Enum(<span class="hljs-string">'LogicOp'</span>, {<span class="hljs-st
</ul> </ul>
<div><h3 id="catchingexceptions">Catching Exceptions</h3><pre><code class="python language-python hljs"><span class="hljs-keyword">except</span> &lt;exception&gt;: <div><h3 id="catchingexceptions">Catching Exceptions</h3><pre><code class="python language-python hljs"><span class="hljs-keyword">except</span> &lt;exception&gt;:
<span class="hljs-keyword">except</span> &lt;exception&gt; <span class="hljs-keyword">as</span> &lt;name&gt;: <span class="hljs-keyword">except</span> &lt;exception&gt; <span class="hljs-keyword">as</span> &lt;name&gt;:
<span class="hljs-keyword">except</span> (&lt;exception&gt;, ...): <span class="hljs-keyword">except</span> (&lt;exception&gt;, [...]):
<span class="hljs-keyword">except</span> (&lt;exception&gt;, ...) <span class="hljs-keyword">as</span> &lt;name&gt;: <span class="hljs-keyword">except</span> (&lt;exception&gt;, [...]) <span class="hljs-keyword">as</span> &lt;name&gt;:
</code></pre></div> </code></pre></div>
<ul> <ul>

|||||||
100:0
Loading…
Cancel
Save