From 2a6fbc87d48858eaab3fdc7e6f632ecbd8701047 Mon Sep 17 00:00:00 2001 From: "V.E.O" Date: Thu, 10 Nov 2016 11:25:12 +0800 Subject: [PATCH] fix import error of resource on windows --- shadowsocks/server.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/shadowsocks/server.py b/shadowsocks/server.py index 6ddd590..aa67303 100755 --- a/shadowsocks/server.py +++ b/shadowsocks/server.py @@ -41,8 +41,11 @@ def main(): daemon.daemon_exec(config) - import resource - logging.info('current process RLIMIT_NOFILE resource: soft %d hard %d' % resource.getrlimit(resource.RLIMIT_NOFILE)) + try: + import resource + logging.info('current process RLIMIT_NOFILE resource: soft %d hard %d' % resource.getrlimit(resource.RLIMIT_NOFILE)) + except ImportError: + pass if config['port_password']: pass