Skip to content

Commit 096bc33

Browse files
authored
Version 1.25 (#84)
- Changing to support Python 3.7 again
1 parent 3cfe093 commit 096bc33

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

.github/workflows/tests.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
fail-fast: false
1717
matrix:
1818
os: [ubuntu-latest]
19-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
19+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
2020
include:
2121
- os: macos-latest
2222
python-version: '3.13'
@@ -36,10 +36,12 @@ jobs:
3636
run: |
3737
python -m pip install --upgrade pip
3838
pip install -r requirements-test.txt
39-
pip install coveralls black==24.4.2 flake8 setuptools wheel twine
39+
pip install coveralls flake8 setuptools wheel twine
4040
4141
- name: Verify Code with Black
42+
if: ${{ matrix.python-version != '3.7' }}
4243
run: |
44+
pip install black==24.4.2
4345
black --check puremagic test
4446
4547
- name: Lint with flake8

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Changelog
22
=========
33

4+
Version 1.25
5+
------------
6+
7+
- Changing to support Python 3.7 again
8+
49
Version 1.24
510
------------
611

puremagic/main.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from itertools import chain
2222

2323
__author__ = "Chris Griffith"
24-
__version__ = "1.24"
24+
__version__ = "1.25"
2525
__all__ = [
2626
"magic_file",
2727
"magic_string",
@@ -433,8 +433,10 @@ def what(file: os.PathLike | str | None, h: bytes | None = None, imghdr_strict:
433433
"""
434434
if isinstance(h, str):
435435
raise TypeError("h must be bytes, not str. Consider using bytes.fromhex(h)")
436-
if h and imghdr_strict and (ext := imghdr_bug_for_bug.get(h)):
437-
return ext
436+
if h and imghdr_strict:
437+
ext = imghdr_bug_for_bug.get(h)
438+
if ext:
439+
return ext
438440
try:
439441
ext = (from_string(h) if h else from_file(file or "")).lstrip(".")
440442
except PureError:

0 commit comments

Comments
 (0)