Avoid "RuntimeError: dictionary changed size during iteration"

This commit is contained in:
Oleksii Shevchuk 2016-12-02 19:29:14 +02:00
parent ef6781f42e
commit 0af2216ada
1 changed files with 6 additions and 3 deletions

View File

@ -12,11 +12,14 @@ import pp
import unicodedata # this is a builtin on linux and .pyd on windows that needs to be embedded
import site
sys_modules = [
(x,sys.modules[x]) for x in sys.modules.keys()
]
all_dependencies=set(
[
x.split('.')[0] for x,m in [
(x,m) for x,m in sys.modules.iteritems()
] if not '(built-in)' in str(m) and x != '__main__'
x.split('.')[0] for x,m in sys_modules \
if not '(built-in)' in str(m) and x != '__main__'
] + [
'Crypto', 'yaml', 'rpyc', 'pyasn1', 'rsa',
'encodings.idna', 'stringprep',