File tree 1 file changed +2
-19
lines changed
1 file changed +2
-19
lines changed Original file line number Diff line number Diff line change 20
20
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
21
# THE SOFTWARE.
22
22
23
- from __future__ import with_statement
24
-
23
+ from bpython ._py3compat import py3
25
24
from bpython import line as lineparts
26
25
import imp
27
26
import os
28
27
import sys
29
28
import warnings
29
+ from warnings import catch_warnings
30
30
31
31
if sys .version_info [0 ] == 3 and sys .version_info [1 ] >= 3 :
32
32
import importlib .machinery
33
33
SUFFIXES = importlib .machinery .all_suffixes ()
34
34
else :
35
35
SUFFIXES = [suffix for suffix , mode , type in imp .get_suffixes ()]
36
36
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
-
54
37
# The cached list of all known modules
55
38
modules = set ()
56
39
fully_loaded = False
You can’t perform that action at this time.
0 commit comments