Skip to content

Commit ae7649e

Browse files
author
Albert
committed
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
1 parent fe62f7b commit ae7649e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

libnmap/process.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@
22
# -*- coding: utf-8 -*-
33

44
import os
5-
import pwd
65
import shlex
76
import subprocess
87
from threading import Thread
98
from xml.dom import pulldom
109
import warnings
10+
try:
11+
import pwd
12+
except ImportError:
13+
pass
1114

1215

1316
__all__ = [

0 commit comments

Comments
 (0)