File tree Expand file tree Collapse file tree 1 file changed +2
-19
lines changed
Expand file tree Collapse file tree 1 file changed +2
-19
lines changed Original file line number Diff line number Diff line change 2020# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2121# THE SOFTWARE.
2222
23- from __future__ import with_statement
24-
23+ from bpython ._py3compat import py3
2524from bpython import line as lineparts
2625import imp
2726import os
2827import sys
2928import warnings
29+ from warnings import catch_warnings
3030
3131if sys .version_info [0 ] == 3 and sys .version_info [1 ] >= 3 :
3232 import importlib .machinery
3333 SUFFIXES = importlib .machinery .all_suffixes ()
3434else :
3535 SUFFIXES = [suffix for suffix , mode , type in imp .get_suffixes ()]
3636
37- try :
38- from warnings import catch_warnings
39- except ImportError :
40- import contextlib
41- @contextlib .contextmanager
42- def catch_warnings ():
43- """Stripped-down version of `warnings.catch_warnings()`
44- (available in Py >= 2.6)."""
45- filters = warnings .filters
46- warnings .filters = list (filters )
47- try :
48- yield
49- finally :
50- warnings .filters = filters
51-
52- from bpython ._py3compat import py3
53-
5437# The cached list of all known modules
5538modules = set ()
5639fully_loaded = False
You can’t perform that action at this time.
0 commit comments