summaryrefslogtreecommitdiffstats
path: root/deluge/tests/__init__.py
blob: 7b6afa19403ed922ef23d356e8e7b89309103658 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Increase open file descriptor limit to allow tests to run
# without getting error: what():  epoll: Too many open files
from deluge.i18n import setup_translation

try:
    import resource
except ImportError:  # Does not exist on Windows
    pass
else:
    try:
        resource.setrlimit(resource.RLIMIT_NOFILE, (65536, 65536))
    except (ValueError, resource.error) as ex:
        error = 'Failed to raise file descriptor limit: %s' % ex
        # print(error)

# Initialize gettext
setup_translation()