summaryrefslogtreecommitdiff
path: root/django/core/management/commands/flush.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/core/management/commands/flush.py')
-rw-r--r--django/core/management/commands/flush.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/django/core/management/commands/flush.py b/django/core/management/commands/flush.py
index 0df5f67e39..f6ae83940a 100644
--- a/django/core/management/commands/flush.py
+++ b/django/core/management/commands/flush.py
@@ -1,4 +1,3 @@
-from contextlib import suppress
from importlib import import_module
from django.apps import apps
@@ -40,8 +39,10 @@ class Command(BaseCommand):
# Import the 'management' module within each installed app, to register
# dispatcher events.
for app_config in apps.get_app_configs():
- with suppress(ImportError):
+ try:
import_module('.management', app_config.name)
+ except ImportError:
+ pass
sql_list = sql_flush(self.style, connection, only_django=True,
reset_sequences=reset_sequences,