mirror of
https://github.com/django/django.git
synced 2025-08-26 21:44:31 +00:00
Fixed #27818 -- Replaced try/except/pass with contextlib.suppress().
This commit is contained in:
parent
43a4835edf
commit
550cb3a365
67 changed files with 223 additions and 368 deletions
|
@ -2,6 +2,7 @@ import decimal
|
|||
import json
|
||||
import unittest
|
||||
import uuid
|
||||
from contextlib import suppress
|
||||
|
||||
from django import forms
|
||||
from django.core import exceptions, serializers, validators
|
||||
|
@ -19,13 +20,11 @@ from .models import (
|
|||
PostgreSQLModel, Tag,
|
||||
)
|
||||
|
||||
try:
|
||||
with suppress(ImportError):
|
||||
from django.contrib.postgres.fields import ArrayField
|
||||
from django.contrib.postgres.forms import (
|
||||
SimpleArrayField, SplitArrayField, SplitArrayWidget,
|
||||
)
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
|
||||
class TestSaveLoad(PostgreSQLTestCase):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue