From ae7649eaea64fa8f55a2cd7ddcbba6a273c6810b Mon Sep 17 00:00:00 2001 From: Albert Date: Sun, 22 Nov 2015 14:15:48 -0800 Subject: [PATCH] Fix import error that does not allow running library in Windows OS The pwd module cannot be imported in Windows (10) OS. This module is only used in sudo* methods so it should not affect the library functionality when running in Windows --- libnmap/process.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libnmap/process.py b/libnmap/process.py index 48f2084..a68d1d9 100644 --- a/libnmap/process.py +++ b/libnmap/process.py @@ -2,12 +2,15 @@ # -*- coding: utf-8 -*- import os -import pwd import shlex import subprocess from threading import Thread from xml.dom import pulldom import warnings +try: + import pwd +except ImportError: + pass __all__ = [