Skip to content

Commit

Permalink
use 3.7-compatible path unlink syntax (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
mathematicalmichael authored Jan 22, 2024
1 parent 86cdf62 commit da43ae2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:
name: texless cli examples
strategy:
matrix:
python-version: ["3.9"]
python-version: ["3.7"]
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
4 changes: 3 additions & 1 deletion src/mud/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ def _check_latex():
plt.plot([0], [1], label=r"$a_\text{foo} = \lambda$")
plt.plot([0, 1], [1, 2], label="Something")
plt.savefig(str(path), bbox_inches="tight")
path.unlink(missing_ok=True)
# For Python 3.7 compatibility
if path.exists():
path.unlink()
_logger.info("USING TEX")
return True
except (RuntimeError, FileNotFoundError):
Expand Down

0 comments on commit da43ae2

Please sign in to comment.