]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Fix typo in sessionmaker example: s/wih/with
authorBrendan McCollam <brendan@mccoll.am>
Thu, 26 Nov 2020 16:04:42 +0000 (11:04 -0500)
committersqla-tester <sqla-tester@sqlalchemy.org>
Thu, 26 Nov 2020 16:04:42 +0000 (11:04 -0500)
<!-- Provide a general summary of your proposed changes in the Title field above -->

### Description
Fix typo in sessionmaker documentation example: s/wih/with

### Checklist
<!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once)

-->

This pull request is:

- [x] A documentation / typographical error fix
- Good to go, no issue or tests are needed
- [ ] A short code fix
- please include the issue number, and create an issue if none exists, which
  must include a complete example of the issue.  one line code fixes without an
  issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.   one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
  include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.

**Have a nice day!**

Closes: #5730
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5730
Pull-request-sha: 2759eefbf32862be464ecd5b1e91163c7773df39

Change-Id: I6226802a598e53f12dbdb97470deaa0f47789faf

lib/sqlalchemy/orm/session.py

index b89edca446599f9c988e99d40240a9cbb2891055..2a531b11833c92c44614062c2ec031f5d174459c 100644 (file)
@@ -3766,7 +3766,7 @@ class sessionmaker(_SessionClassMethods):
 
         Session = sessionmaker(engine)
 
-        wih Session.begin() as session:
+        with Session.begin() as session:
             session.add(some_object)
             session.add(some_other_object)
         # commits transaction, closes session