mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #27818 -- Replaced try/except/pass with contextlib.suppress().
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user