Skip to content

Commit

Permalink
replace os.uname() with platform.uname() for Windows support
Browse files Browse the repository at this point in the history
  • Loading branch information
petermbauer committed Sep 20, 2023
1 parent 90464ac commit 383e2ac
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion analyzer/codechecker_analyzer/analyzer_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from distutils.spawn import find_executable

import os
import platform
import sys

from pathlib import Path
Expand Down Expand Up @@ -65,7 +66,7 @@ def __init__(self):
self.__analyzers = {}
self.__analyzer_env = None

machine = os.uname().machine
machine = platform.uname().machine

self.logger_lib_dir_path = os.path.join(
self._data_files_dir_path, 'ld_logger', 'lib', machine)
Expand Down
3 changes: 2 additions & 1 deletion analyzer/tests/unit/test_log_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import json
import os
import platform
import shutil
import tempfile
import unittest
Expand Down Expand Up @@ -684,5 +685,5 @@ def test_get_log_env(self):

# Make sure that the test running machine architecture is in the
# LD_PRELOAD path.
machine = os.uname().machine
machine = platform.uname().machine
self.assertTrue(env["LD_PRELOAD"].endswith(machine + "/ldlogger.so"))
3 changes: 2 additions & 1 deletion analyzer/tools/build-logger/tests/unit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import json
import os
import platform
import shlex
import subprocess
import tempfile
Expand Down Expand Up @@ -106,7 +107,7 @@ def read_actual_json(self) -> str:
return fd.read()

def get_envvars(self) -> Mapping[str, str]:
machine = os.uname().machine
machine = platform.uname().machine
return {
"PATH": os.getenv("PATH"),
"LD_PRELOAD": os.path.join(LOGGER_DIR,
Expand Down

0 comments on commit 383e2ac

Please sign in to comment.