diff options
author | Joel Rosdahl <joel@rosdahl.net> | 2014-06-23 22:14:14 +0200 |
---|---|---|
committer | Joel Rosdahl <joel@rosdahl.net> | 2014-06-23 22:14:14 +0200 |
commit | 3ac33094c2dc633b461853e21fadb5ea81462118 (patch) | |
tree | 6d16462aeee236757ff21e7c431da3dfc965cf9f | |
parent | bc02cbd8939093189712a97ae4df2babeb8d14ce (diff) | |
download | miniircd-3ac33094c2dc633b461853e21fadb5ea81462118.tar.gz miniircd-3ac33094c2dc633b461853e21fadb5ea81462118.zip |
Only import pwd and grp modules when needed since Windows doesn't have them
-rwxr-xr-x | miniircd | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -32,8 +32,6 @@ import tempfile import time from datetime import datetime from optparse import OptionParser -from pwd import getpwnam -from grp import getgrnam def create_directory(path): if not os.path.isdir(path): @@ -873,6 +871,8 @@ def main(argv): if os.getuid() != 0: op.error("Must be root to use --chroot") if options.setuid: + from pwd import getpwnam + from grp import getgrnam if os.getuid() != 0: op.error("Must be root to use --setuid") match = re.findall(r"([a-z_][a-z0-9_-]*\$?)", options.setuid) |