Skip to content

Commit cd4c9f6

Browse files
committed
Simplify code and just require python 3.10+
1 parent 0830625 commit cd4c9f6

4 files changed

Lines changed: 7 additions & 19 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
fail-fast: false
1010
matrix:
11-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
11+
python-version: ['3.10', '3.11', '3.12', '3.13']
1212
services:
1313
postgres:
1414
image: postgres
@@ -45,7 +45,7 @@ jobs:
4545
strategy:
4646
fail-fast: false
4747
matrix:
48-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
48+
python-version: ['3.10', '3.11', '3.12', '3.13']
4949
services:
5050
mariadb:
5151
image: mariadb:latest
@@ -82,7 +82,7 @@ jobs:
8282
strategy:
8383
fail-fast: false
8484
matrix:
85-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
85+
python-version: ['3.10', '3.11', '3.12', '3.13']
8686

8787
services:
8888
mongodb:
@@ -107,7 +107,7 @@ jobs:
107107
runs-on: ubuntu-latest
108108
strategy:
109109
matrix:
110-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
110+
python-version: ['3.10', '3.11', '3.12', '3.13']
111111
steps:
112112
- uses: actions/checkout@v3
113113
- name: Setup python ${{ matrix.python-version}}

atomdb/base.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import asyncio
1212
import enum
1313
import logging
14-
import sys
1514
import traceback
1615
from base64 import b64decode, b64encode
1716
from collections.abc import MutableMapping
@@ -57,16 +56,6 @@
5756

5857
PRIMITIVE_TYPES = (int, float, bool, str)
5958

60-
if sys.version_info >= (3, 10):
61-
62-
def format_exception(e: Exception) -> str:
63-
return "".join(traceback.format_exception(e))
64-
65-
else:
66-
67-
def format_exception(e: Exception) -> str:
68-
return "".join(traceback.format_exception(e.__class__, e))
69-
7059

7160
def find_subclasses(cls: Type[T]) -> ListType[Type[T]]:
7261
"""Finds subclasses of the given class"""
@@ -776,7 +765,7 @@ def __log_restore_error__(
776765
f"\nRef: {hex(id(self))}"
777766
f"\nScope: {pformat(scope)}"
778767
f"\nState: {pformat(state)}"
779-
f"\n{format_exception(e)}"
768+
f"\n{"".join(traceback.format_exception(e))}"
780769
)
781770

782771
# --------------------------------------------------------------------------

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def find_version():
3939
long_description=open("README.md").read(),
4040
long_description_content_type="text/markdown",
4141
requires=["atom"],
42-
python_requires=">=3.7",
42+
python_requires=">=3.10",
4343
install_requires=["atom>=0.7.0"],
4444
optional_requires=[
4545
"sqlalchemy<2",

src/ext.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ static PyObject* atomlist_owner(PyObject* mod, PyObject* obj)
5050
struct AtomList* alist = (struct AtomList*) obj;
5151
if (!alist->pointer || !alist->pointer->data)
5252
Py_RETURN_NONE;
53-
Py_INCREF(alist->pointer->data);
54-
return alist->pointer->data;
53+
return Py_NewRef(alist->pointer->data);
5554
}
5655

5756
static PyMethodDef ext_methods[] = {

0 commit comments

Comments
 (0)