From b4708fc2cbc4f954f89a00f5e1eea7f1e3acaa91 Mon Sep 17 00:00:00 2001 From: shreyamalviya Date: Thu, 20 May 2021 16:55:27 +0530 Subject: [PATCH] Import Windows specific modules only on Windows systems --- .../cc/environment/windows_permissions.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/monkey/monkey_island/cc/environment/windows_permissions.py b/monkey/monkey_island/cc/environment/windows_permissions.py index 5d4913151..d17947a2e 100644 --- a/monkey/monkey_island/cc/environment/windows_permissions.py +++ b/monkey/monkey_island/cc/environment/windows_permissions.py @@ -1,7 +1,10 @@ -import ntsecuritycon -import win32api -import win32con -import win32security +from monkey_island.cc.environment.utils import is_windows_os + +if is_windows_os(): + import ntsecuritycon + import win32api + import win32con + import win32security def set_full_folder_access(folder_path: str) -> None: