From f05bea4e101c7f1aab0122eb83e2b68089327807 Mon Sep 17 00:00:00 2001 From: noisyfox Date: Sat, 7 Jan 2017 19:34:39 +1100 Subject: [PATCH] Fix crash on windows --- db_transfer.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/db_transfer.py b/db_transfer.py index dcc158e..2ef5829 100644 --- a/db_transfer.py +++ b/db_transfer.py @@ -198,8 +198,13 @@ class TransferBase(object): db_instance = obj() ServerPool.get_instance() shell.log_shadowsocks_version() - 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: + pass + try: while True: load_config()