Skip to content

Commit da43ae2

Browse files
use 3.7-compatible path unlink syntax (#77)
1 parent 86cdf62 commit da43ae2

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.github/workflows/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ jobs:
9999
name: texless cli examples
100100
strategy:
101101
matrix:
102-
python-version: ["3.9"]
102+
python-version: ["3.7"]
103103
runs-on: ubuntu-latest
104104
steps:
105105
- name: Checkout

src/mud/plot.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ def _check_latex():
2929
plt.plot([0], [1], label=r"$a_\text{foo} = \lambda$")
3030
plt.plot([0, 1], [1, 2], label="Something")
3131
plt.savefig(str(path), bbox_inches="tight")
32-
path.unlink(missing_ok=True)
32+
# For Python 3.7 compatibility
33+
if path.exists():
34+
path.unlink()
3335
_logger.info("USING TEX")
3436
return True
3537
except (RuntimeError, FileNotFoundError):

0 commit comments

Comments
 (0)