Skip to content

Commit 64a5331

Browse files
committed
remove unnecessary try blocks
1 parent 5e24a7d commit 64a5331

File tree

11 files changed

+960
-967
lines changed

11 files changed

+960
-967
lines changed

.safety-policy.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

doc/.readthedocs.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@ build:
1212
python: "3.12"
1313
jobs:
1414
post_create_environment:
15-
- pip install poetry==1.7.1 # 1.8 has a bug preventing this build from working
16-
- poetry config virtualenvs.create false
15+
- pip install poetry
1716
post_install:
18-
- poetry install
17+
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH python -m poetry install -E all
1918

2019
# Build documentation in the docs/ directory with Sphinx
2120
sphinx:

doc/source/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
# ones.
4141
extensions = [
4242
'sphinx.ext.autodoc',
43-
'sphinxarg.ext',
4443
'sphinx.ext.todo'
4544
]
4645

doc/source/performance.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ An effort is made to characterize and monitor the performance penalty of
1616
using ``EnumFields`` over a Django_ native field with choices and benchmark
1717
tests ensure performance of future releases will remain stable or improve.
1818

19-
For the nominal case the deserialization penalty is roughly equivalent to a map
19+
For the nominal case the marshalling penalty is roughly equivalent to a map
2020
lookup, but may involve several exception stack unwinds in unusual non-strict
2121
or eccentric enumeration cases.
2222

2323
.. note::
2424

25-
The deserialization penalty can be eliminated by setting ``coerce`` to
25+
The marshalling penalty can be eliminated by setting ``coerce`` to
2626
``False``. This will require the developer to manually coerce the
2727
``EnumField`` value to an Enum_ type object and is therefore usually
2828
not recommended - but may be appropriate if the dominate use case involves

tests/enum_prop/admin.py

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
1-
try:
2-
from django.contrib import admin
1+
from django.contrib import admin
32

4-
from tests.enum_prop.models import (
5-
AdminDisplayBug35,
6-
BitFieldModel,
7-
EnumTester,
8-
)
3+
from tests.enum_prop.models import (
4+
AdminDisplayBug35,
5+
BitFieldModel,
6+
EnumTester,
7+
)
98

10-
class AdminDisplayBug35Admin(admin.ModelAdmin):
11-
list_display = ("text_enum", "int_enum")
12-
readonly_fields = ("text_enum", "int_enum", "blank_int", "blank_txt")
139

14-
admin.site.register(EnumTester)
15-
admin.site.register(BitFieldModel)
16-
admin.site.register(AdminDisplayBug35, AdminDisplayBug35Admin)
10+
class AdminDisplayBug35Admin(admin.ModelAdmin):
11+
list_display = ("text_enum", "int_enum")
12+
readonly_fields = ("text_enum", "int_enum", "blank_int", "blank_txt")
1713

18-
except (ImportError, ModuleNotFoundError): # pragma: no cover
19-
pass
14+
15+
admin.site.register(EnumTester)
16+
admin.site.register(BitFieldModel)
17+
admin.site.register(AdminDisplayBug35, AdminDisplayBug35Admin)

tests/enum_prop/apps.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
try:
2-
import enum_properties
3-
from django.apps import AppConfig
1+
import enum_properties
2+
from django.apps import AppConfig
43

5-
class EnumPropConfig(AppConfig):
6-
name = "tests.enum_prop"
7-
label = name.replace(".", "_")
84

9-
except (ImportError, ModuleNotFoundError): # pragma: no cover
10-
pass
5+
class EnumPropConfig(AppConfig):
6+
name = "tests.enum_prop"
7+
label = name.replace(".", "_")

0 commit comments

Comments
 (0)