Skip to content

Commit e5c2984

Browse files
waskyosipma
authored andcommitted
small tweak to allow importing the CHB python code in windows
os.uname is not present in windows, but platform.uname is. note that this only allows you to import the code in windows, depending on what functionality is needed, additional changes will be needed
1 parent 23ec2ab commit e5c2984

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

chb/util/Config.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"""Contains the locations of various components used by the analyzer."""
3030

3131
import os
32+
import platform
3233

3334
from typing import Any, Dict, List
3435

@@ -44,10 +45,12 @@ class Config():
4445

4546
def __init__(self) -> None:
4647
# platform settings
47-
if os.uname()[0] == 'Linux':
48+
if platform.uname()[0] == 'Linux':
4849
self.platform = 'linux'
49-
elif os.uname()[0] == 'Darwin':
50+
elif platform.uname()[0] == 'Darwin':
5051
self.platform = 'macOS'
52+
else:
53+
self.platform = "Unknown"
5154

5255
# general settings
5356
self.utildir = os.path.dirname(os.path.abspath(__file__))

0 commit comments

Comments
 (0)