Skip to content

Commit

Permalink
Merge pull request matplotlib#17883 from QuLogic/remove-py36
Browse files Browse the repository at this point in the history
Remove Python 3.6 compatibility shims
  • Loading branch information
story645 authored Jul 12, 2020
2 parents 2f5ef82 + d6255f0 commit 2707208
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 22 deletions.
5 changes: 1 addition & 4 deletions lib/matplotlib/backends/backend_agg.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@
import threading
except ImportError:
import dummy_threading as threading
try:
from contextlib import nullcontext
except ImportError:
from contextlib import ExitStack as nullcontext # Py 3.6.
from contextlib import nullcontext
from math import radians, cos, sin

import numpy as np
Expand Down
5 changes: 1 addition & 4 deletions lib/matplotlib/backends/backend_gtk3cairo.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
try:
from contextlib import nullcontext
except ImportError:
from contextlib import ExitStack as nullcontext # Py 3.6.
from contextlib import nullcontext

from . import backend_cairo, backend_gtk3
from .backend_gtk3 import Gtk, _BackendGTK3
Expand Down
7 changes: 2 additions & 5 deletions lib/matplotlib/testing/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
import sys
import unittest
import warnings
try:
from contextlib import nullcontext
except ImportError:
from contextlib import ExitStack as nullcontext # Py3.6.

import matplotlib as mpl
import matplotlib.style
Expand Down Expand Up @@ -219,7 +215,8 @@ def compare(self, idx, baseline, extension, *, _lock=False):
{'Creator': None, 'Producer': None,
'CreationDate': None})

lock = cbook._lock_path(actual_path) if _lock else nullcontext()
lock = (cbook._lock_path(actual_path)
if _lock else contextlib.nullcontext())
with lock:
fig.savefig(actual_path, **kwargs)
expected_path = self.copy_baseline(baseline, extension)
Expand Down
5 changes: 1 addition & 4 deletions lib/matplotlib/tests/test_figure.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
from contextlib import nullcontext
from datetime import datetime
import io
from pathlib import Path
import platform
from types import SimpleNamespace
import warnings
try:
from contextlib import nullcontext
except ImportError:
from contextlib import ExitStack as nullcontext # Py3.6

import matplotlib as mpl
from matplotlib import cbook, rcParams
Expand Down
5 changes: 1 addition & 4 deletions lib/matplotlib/tests/test_ticker.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
try:
from contextlib import nullcontext
except ImportError:
from contextlib import ExitStack as nullcontext # Py 3.6.
from contextlib import nullcontext
import re
import itertools

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,9 @@ def build_extensions(self):
'License :: OSI Approved :: Python Software Foundation License',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Topic :: Scientific/Engineering :: Visualization',
],

Expand Down

0 comments on commit 2707208

Please sign in to comment.