From 3ac33094c2dc633b461853e21fadb5ea81462118 Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Mon, 23 Jun 2014 22:14:14 +0200 Subject: Only import pwd and grp modules when needed since Windows doesn't have them --- miniircd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/miniircd b/miniircd index 580574e..22f8773 100755 --- a/miniircd +++ b/miniircd @@ -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) -- cgit v1.2.3