Skip to content

Commit 327b4c9

Browse files
committed
Remove obsolete workarounds
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
1 parent ba14a3e commit 327b4c9

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

bpython/importcompletion.py

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,37 +20,20 @@
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
2524
from bpython import line as lineparts
2625
import imp
2726
import os
2827
import sys
2928
import warnings
29+
from warnings import catch_warnings
3030

3131
if sys.version_info[0] == 3 and sys.version_info[1] >= 3:
3232
import importlib.machinery
3333
SUFFIXES = importlib.machinery.all_suffixes()
3434
else:
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
5538
modules = set()
5639
fully_loaded = False

0 commit comments

Comments
 (0)