Fix: crash in case of not installed pytz #318
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This small change fixes the crash In case of not installed
pytz
.Here is example errors traceback:
Traceback (most recent call last): File ".../main.py", line 14, in <module> import arq.cli File "....../venv/lib/python3.9/site-packages/arq/__init__.py", line 1, in <module> from .connections import ArqRedis, create_pool # noqa F401 File "....../venv/lib/python3.9/site-packages/arq/connections.py", line 18, in <module> from .jobs import Deserializer, Job, JobDef, JobResult, Serializer, deserialize_job, serialize_job File "....../venv/lib/python3.9/site-packages/arq/jobs.py", line 13, in <module> from .utils import ms_to_datetime, poll, timestamp_ms File "....../venv/lib/python3.9/site-packages/arq/utils.py", line 38, in <module> def get_tz() -> Optional[pytz.BaseTzInfo]: AttributeError: 'NoneType' object has no attribute 'BaseTzInfo'