Update pelican_quickstart.py

Fixes bug of missing zone attribute caused by tzlocal 4.0 API change.
This commit is contained in:
Moritz Meier 2023-06-25 15:15:36 +02:00 committed by GitHub
commit 7bd775b9bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,7 +16,10 @@ except ImportError:
try:
import tzlocal
_DEFAULT_TIMEZONE = tzlocal.get_localzone().zone
if hasattr(tzlocal.get_localzone(), "zone"):
_DEFAULT_TIMEZONE = tzlocal.get_localzone().zone
else:
_DEFAULT_TIMEZONE = tzlocal.get_localzone_name()
except ImportError:
_DEFAULT_TIMEZONE = 'Europe/Rome'