Skip to content

Commit

Permalink
timezone env added
Browse files Browse the repository at this point in the history
  • Loading branch information
stt08 committed Sep 13, 2024
1 parent 3fb98f1 commit d33660c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions analyzer/codechecker_analyzer/analyzers/infer/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ def analyze(self, analyzer_cmd, res_handler, proc_callback=None, env=None):
with open(original_env_file, 'rb') as env_file:
env = pickle.load(env_file, encoding='utf-8')

if "TZ" not in env:
env["TZ"] = "UTC"

result_handler = super().analyze(
analyzer_cmd, res_handler, proc_callback, env)

Expand Down Expand Up @@ -183,10 +186,9 @@ def get_binary_version(cls, environ, details=False) -> str:
# No need to LOG here, we will emit a warning later anyway.
if not cls.analyzer_binary():
return None
if details:
version = [cls.analyzer_binary(), '--version']
else:
version = [cls.analyzer_binary(), '--version']
if "TZ" not in environ:
environ["TZ"] = "UTC"
version = [cls.analyzer_binary(), '--version']
try:
output = subprocess.check_output(version,
env=environ,
Expand Down

0 comments on commit d33660c

Please sign in to comment.