From 712fe12466cfe4b7e31c61418c85ce36a211261a Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Mon, 1 Mar 2021 04:54:02 -0500 Subject: [PATCH] Refs #23919 -- Removed unneeded AttributeError catching in collectstatic's link_file(). os.symlink() exists always on Python 3.2+. --- .../contrib/staticfiles/management/commands/collectstatic.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/django/contrib/staticfiles/management/commands/collectstatic.py b/django/contrib/staticfiles/management/commands/collectstatic.py index f7e069b20b..9d4c2d5006 100644 --- a/django/contrib/staticfiles/management/commands/collectstatic.py +++ b/django/contrib/staticfiles/management/commands/collectstatic.py @@ -314,10 +314,6 @@ class Command(BaseCommand): if os.path.lexists(full_path): os.unlink(full_path) os.symlink(source_path, full_path) - except AttributeError: - import platform - raise CommandError("Symlinking is not supported by Python %s." % - platform.python_version()) except NotImplementedError: import platform raise CommandError("Symlinking is not supported in this "