Skip to content

Commit df76220

Browse files
committed
fix typos in the context-managers.ipynb
1 parent 03fb885 commit df76220

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Context Managers/context-managers.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@
161161
"cell_type": "markdown",
162162
"metadata": {},
163163
"source": [
164-
"Note that the `__exit__` method takes three arguments, which are required by every `__exit__` method in a Context Manager class. If an exception occurs, Python passes the `type`, `value` and `traceback` of the exception to the `__exit__` method. It allows the `__exit__` method to decide how to close the file and if any further steps are required. In our case we are simply them.\n",
164+
"Note that the `__exit__` method takes three arguments, which are required by every `__exit__` method in a Context Manager class. If an exception occurs, Python passes the `type`, `value` and `traceback` of the exception to the `__exit__` method. It allows the `__exit__` method to decide how to close the file and if any further steps are required. In our case we are simply ignoring them.\n",
165165
"\n",
166166
"Now, we can try our Context Manager to see if it works as intended:"
167167
]
@@ -352,7 +352,7 @@
352352
" return self.file_obj\n",
353353
" def __exit__(self, type, value, traceback):\n",
354354
" if type:\n",
355-
" print(\"Exception encounted!\")\n",
355+
" print(\"Exception encountered!\")\n",
356356
" print(f\"\\t Traceback: {traceback}\")\n",
357357
" print(f\"\\t Type: {type}, Value: {value}\")\n",
358358
" print(\"This exception will be ignored.\")\n",

0 commit comments

Comments
 (0)