diff --git a/django/contrib/staticfiles/management/commands/collectstatic.py b/django/contrib/staticfiles/management/commands/collectstatic.py index 341537ffa7..dd597ada07 100644 --- a/django/contrib/staticfiles/management/commands/collectstatic.py +++ b/django/contrib/staticfiles/management/commands/collectstatic.py @@ -50,8 +50,9 @@ class Command(NoArgsCommand): self.local = False else: self.local = True - # Use ints for file times (ticket #14665) - os.stat_float_times(False) + # Use ints for file times (ticket #14665), if supported + if hasattr(os, 'stat_float_times'): + os.stat_float_times(False) def handle_noargs(self, **options): self.clear = options['clear']