Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
View all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
python
/
cpython
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
36.3k
Star
77.3k
Code
Issues
5k+
Pull requests
2.7k
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Commits
Breadcrumbs
History for
cpython
Lib
contextlib.py
on
3.5
User selector
All users
Datepicker
All time
Commit history
Commits on Apr 13, 2017
[3.5] bpo-29692: contextlib.contextmanager may incorrectly unchain RuntimeError (GH-949) (#1107)
Show description for 4d015a4
Mariatta
authored
4d015a4
View commit details
Copy full SHA for 4d015a4
View code at this point
Browse repository at this point
[3.5] Clarify exception handler scope in contextlib (GH-1104)
Show description for c0f4240
Mariatta
authored
c0f4240
View commit details
Copy full SHA for c0f4240
View code at this point
Browse repository at this point
Commits on Feb 12, 2017
bpo-27122: Fix comment to point to correct issue number (#50)
Show description for c6d2f49
berkerpeksag
authored
c6d2f49
View commit details
Copy full SHA for c6d2f49
View code at this point
Browse repository at this point
Commits on Jun 14, 2016
Issue #27123: When an exception is raised within the context being
Show description for ba2ecd6
gpshead
committed
ba2ecd6
View commit details
Copy full SHA for ba2ecd6
View code at this point
Browse repository at this point
Commits on Jun 28, 2015
Issue #24336: The contextmanager decorator now works with functions with
Show description for eab7704
serhiy-storchaka
committed
eab7704
View commit details
Copy full SHA for eab7704
View code at this point
Browse repository at this point
Issue #24336: The contextmanager decorator now works with functions with
Show description for 101ff35
serhiy-storchaka
committed
101ff35
View commit details
Copy full SHA for 101ff35
View code at this point
Browse repository at this point
Commits on May 9, 2015
PEP 479: Change StopIteration handling inside generators.
Show description for 8170e8c
Yury Selivanov
committed
8170e8c
View commit details
Copy full SHA for 8170e8c
View code at this point
Browse repository at this point
Commits on Nov 28, 2014
Issue #22389: Add contextlib.redirect_stderr().
berkerpeksag
committed
bb44fe0
View commit details
Copy full SHA for bb44fe0
View code at this point
Browse repository at this point
Commits on Jan 24, 2014
Merge removal of issue 20317 debugging code from 3.3
ncoghlan
committed
b3c0f40
View commit details
Copy full SHA for b3c0f40
View code at this point
Browse repository at this point
Issue 20317: Remove debugging code from contextlib
Show description for add94c9
ncoghlan
committed
add94c9
View commit details
Copy full SHA for add94c9
View code at this point
Browse repository at this point
Commits on Jan 22, 2014
Merge #20317 from 3.3
ncoghlan
committed
d58831e
View commit details
Copy full SHA for d58831e
View code at this point
Browse repository at this point
Issue #20317: Don't create a reference loop in ExitStack
ncoghlan
committed
09761e7
View commit details
Copy full SHA for 09761e7
View code at this point
Browse repository at this point
Commits on Nov 3, 2013
Close #19403: make contextlib.redirect_stdout reentrant
ncoghlan
committed
8e113b4
View commit details
Copy full SHA for 8e113b4
View code at this point
Browse repository at this point
Commits on Oct 26, 2013
Close #19330 by using public classes in contextlib
Show description for 059def5
ncoghlan
committed
059def5
View commit details
Copy full SHA for 059def5
View code at this point
Browse repository at this point
Commits on Oct 19, 2013
contextlib doc updates and refactoring
Show description for 8608d26
ncoghlan
committed
8608d26
View commit details
Copy full SHA for 8608d26
View code at this point
Browse repository at this point
Commits on Oct 17, 2013
Close #19266: contextlib.ignore -> contextlib.suppress
Show description for 240f86d
ncoghlan
committed
240f86d
View commit details
Copy full SHA for 240f86d
View code at this point
Browse repository at this point
Commits on Oct 11, 2013
Rename contextlib.ignored() to contextlib.ignore().
rhettinger
committed
1254b40
View commit details
Copy full SHA for 1254b40
View code at this point
Browse repository at this point
Commits on Oct 10, 2013
Issue #15805: Add contextlib.redirect_stdout()
rhettinger
committed
088cbf2
View commit details
Copy full SHA for 088cbf2
View code at this point
Browse repository at this point
Commits on Oct 1, 2013
Merge #19092 from 3.3
ncoghlan
committed
e6f4631
View commit details
Copy full SHA for e6f4631
View code at this point
Browse repository at this point
Close #19092: ExitStack now reraises exceptions from __exit__
Show description for 1a33b2f
ncoghlan
committed
1a33b2f
View commit details
Copy full SHA for 1a33b2f
View code at this point
Browse repository at this point
Commits on Aug 17, 2013
#18705: merge with 3.3.
ezio-melotti
committed
9a3777e
View commit details
Copy full SHA for 9a3777e
View code at this point
Browse repository at this point
Commits on Mar 11, 2013
Issue #15806: Add contextlib.ignored().
rhettinger
committed
e318a88
View commit details
Copy full SHA for e318a88
View code at this point
Browse repository at this point
Commits on Dec 18, 2012
Issue #16714: use 'raise' exceptions, don't 'throw'.
Show description for 5b89840
asvetlov
committed
5b89840
View commit details
Copy full SHA for 5b89840
View code at this point
Browse repository at this point
Commits on Jun 1, 2012
Close #14969: Improve the handling of exception chaining in contextlib.ExitStack
ncoghlan
committed
77452fc
View commit details
Copy full SHA for 77452fc
View code at this point
Browse repository at this point
Commits on May 31, 2012
Close #14963: Use an iterative algorithm in contextlib.ExitStack.__exit__ (Patch by Alon Horev)
ncoghlan
committed
a5bd2a1
View commit details
Copy full SHA for a5bd2a1
View code at this point
Browse repository at this point
Commits on May 21, 2012
Close #13585: add contextlib.ExitStack to replace the ill-fated contextlib.nested API
ncoghlan
committed
3267a30
View commit details
Copy full SHA for 3267a30
View code at this point
Browse repository at this point
Commits on Jun 28, 2011
remove unused imports (closes #12432)
Show description for 274271d
benjaminp
committed
274271d
View commit details
Copy full SHA for 274271d
View code at this point
Browse repository at this point
Commits on May 5, 2011
Remove trailing whitespace
ncoghlan
committed
fdc2c55
View commit details
Copy full SHA for fdc2c55
View code at this point
Browse repository at this point
Issue #11647: allow contextmanager objects to be used as decorators as described in the docs. Initial patch by Ysj Ray.
ncoghlan
committed
0ded3e3
View commit details
Copy full SHA for 0ded3e3
View code at this point
Browse repository at this point
Commits on Jan 8, 2011
Issue #10859: Make `contextlib.GeneratorContextManager` officially
Show description for 67b212e
pitrou
committed
67b212e
View commit details
Copy full SHA for 67b212e
View code at this point
Browse repository at this point
Commits on Jun 30, 2010
Issue 9110. Adding ContextDecorator to contextlib. This enables the creation of APIs that act as decorators as well as context managers. contextlib.contextmanager changed to use ContextDecorator.
Michael Foord
committed
b3a8984
View commit details
Copy full SHA for b3a8984
View code at this point
Browse repository at this point
Commits on Jul 1, 2009
remove nested from __all__
benjaminp
committed
04e40c1
View commit details
Copy full SHA for 04e40c1
View code at this point
Browse repository at this point
Removed contextlib.nested()
rhettinger
committed
9c4d0ed
View commit details
Copy full SHA for 9c4d0ed
View code at this point
Browse repository at this point
Commits on Jun 23, 2009
Merged revisions 73518-73519 via svnmerge from
Show description for b7706b5
ncoghlan
committed
b7706b5
View commit details
Copy full SHA for b7706b5
View code at this point
Browse repository at this point
Commits on Jun 10, 2009
Issue 6256: Fix stacklevel in warning message.
rhettinger
committed
fde29be
View commit details
Copy full SHA for fde29be
View code at this point
Browse repository at this point
Previous
Next
You can’t perform that action at this time.