From 0af2216adaf158b9a82fd47cc69e5f743a40d438 Mon Sep 17 00:00:00 2001 From: Oleksii Shevchuk Date: Fri, 2 Dec 2016 19:29:14 +0200 Subject: [PATCH] Avoid "RuntimeError: dictionary changed size during iteration" --- client/build_library_zip.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/client/build_library_zip.py b/client/build_library_zip.py index 498dff27..cd091969 100644 --- a/client/build_library_zip.py +++ b/client/build_library_zip.py @@ -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',