Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2f715ce

Browse files
committed
Exceptions
1 parent daaa45b commit 2f715ce

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1374,7 +1374,7 @@ except (<exception>, [...]) as <name>:
13741374
```
13751375
* **Also catches subclasses of the exception.**
13761376
* **Use `'traceback.print_exc()'` to print the error message to stderr.**
1377-
* **Use `'print(<name>, file=sys.stderr)'` to print just the cause of the exception.**
1377+
* **Use `'print(<name>)'` to print just the cause of the exception (its arguments).**
13781378

13791379
### Raising Exceptions
13801380
```python

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1311,7 +1311,7 @@
13111311
<ul>
13121312
<li><strong>Also catches subclasses of the exception.</strong></li>
13131313
<li><strong>Use <code class="python hljs"><span class="hljs-string">'traceback.print_exc()'</span></code> to print the error message to stderr.</strong></li>
1314-
<li><strong>Use <code class="python hljs"><span class="hljs-string">'print(&lt;name&gt;, file=sys.stderr)'</span></code> to print just the cause of the exception.</strong></li>
1314+
<li><strong>Use <code class="python hljs"><span class="hljs-string">'print(&lt;name&gt;)'</span></code> to print just the cause of the exception (its arguments).</strong></li>
13151315
</ul>
13161316
<div><h3 id="raisingexceptions">Raising Exceptions</h3><pre><code class="python language-python hljs"><span class="hljs-keyword">raise</span> &lt;exception&gt;
13171317
<span class="hljs-keyword">raise</span> &lt;exception&gt;()

0 commit comments

Comments
 (0)