Skip to content

Commit 45e9ceb

Browse files
committed
Remove deprecated distutils code.
1 parent ea99c7c commit 45e9ceb

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ dependencies = [
2323
"custom_inherit",
2424
"multipledispatch",
2525
"numpy>=1.8.0",
26+
"packaging",
2627
"pypng",
2728
"reportlab",
2829
]

toyplot/reportlab/png.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
"""
77

88

9-
import distutils.version
109
import io
1110
import subprocess
1211

12+
from packaging.version import Version
1313
import reportlab.pdfgen.canvas
1414

1515
import toyplot.reportlab
@@ -29,7 +29,7 @@
2929
if _gs_command is None:
3030
raise Exception("A ghostscript executable is required.") # pragma: no cover
3131

32-
if distutils.version.StrictVersion(_gs_version) >= "9.14":
32+
if Version(_gs_version) >= Version("9.14"):
3333
_gs_resolution = ["-r%s" % (96 * 4), "-dDownScaleFactor=4"]
3434
else: # pragma: no cover
3535
_gs_resolution = ["-r%s" % (96)]

0 commit comments

Comments
 (0)