Skip to content
Navigation Menu
Sign in
Products
Platform
GitHub
Repository hosting, code review, and collaboration
Copilot
AI coding agent for tasks, projects, and automated work
Build & Ship
Actions
CI/CD and automation
Code Quality
Quality analysis, fixes, and enforcement
Codespaces
Cloud development environments
Secure
Code Security
Vulnerability detection and remediation
Secret Protection
Secret scanning and leak prevention
All Features
Developers
Learn
Documentation
Training
Certifications
Build
Build with Copilot
Customize Copilot
Integrations
Explore
Trending repos
GitHub Sponsors
Developer articles
Changelog
Changelog
Your source for the latest features, improvements, and fixes across GitHub products, all in one place.
Businesses
By Stage
Enterprises
Team
Startups
Nonprofits
By Industry
Healthcare
Financial services
Manufacturing
Government
See all industries
Evaluate GitHub
Why GitHub
Customer Stories
Business insights
Trust Center
Add-ons
GitHub Advanced Security
Enterprise-grade code security
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Resources
Learn & Connect
Documentation
Resource center
Blog
Events & webinars
Community Forum
Customer Stories
Integrations
Support
Customer support
Training
GitHub Status
Company
About
Partners
Changelog
GitHub Universe
GitHub Universe
The event for developers, by developers — talks, workshops, and what’s next for GitHub.
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 }}
foxfluff
cpython
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
More
items
Commits
Breadcrumbs
History for
cpython
Lib
contextlib.py
on
master
User selector
All users
Datepicker
All time
Commit history
Commits on Feb 12, 2017
bpo-27122: Fix comment to point to correct issue number (#47)
Show description for af88e7e
njsmith
authored and
berkerpeksag
committed
af88e7e
View commit details
Copy full SHA for af88e7e
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 881aa38
gpshead
committed
881aa38
View commit details
Copy full SHA for 881aa38
View code at this point
Browse repository at this point
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 Apr 8, 2016
Normalize whitespace
brettcannon
committed
8bd092b
View commit details
Copy full SHA for 8bd092b
View code at this point
Browse repository at this point
Issue #25609: Introduce contextlib.AbstractContextManager and
Show description for 9e080e0
brettcannon
committed
9e080e0
View commit details
Copy full SHA for 9e080e0
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
Previous
Next
You can’t perform that action at this time.