comparison setup.py @ 42174:bd92dd3eff42 stable

setup: remove set and dict comprehensions Yuya observed in a recent review that it is worthwhile to keep setup.py parseable with Python 2.6 so a useful error message is seen when attempting to run with Python 2.6. This commit removes a set and dict comprehension so setup.py is parseable with Python 2.6.
author Gregory Szorc <gregory.szorc@gmail.com>
date Sun, 21 Apr 2019 07:21:08 -0700
parents 71d8b4d91616
children cd1bede340b0
comparison
equal deleted inserted replaced
42173:07faf5c65190 42174:bd92dd3eff42
793 '\n'.join([out, err])) 793 '\n'.join([out, err]))
794 794
795 normalizecrlf('doc/%s.html' % root) 795 normalizecrlf('doc/%s.html' % root)
796 796
797 # This logic is duplicated in doc/Makefile. 797 # This logic is duplicated in doc/Makefile.
798 sources = {f for f in os.listdir('mercurial/help') 798 sources = set(f for f in os.listdir('mercurial/help')
799 if re.search(r'[0-9]\.txt$', f)} 799 if re.search(r'[0-9]\.txt$', f))
800 800
801 # common.txt is a one-off. 801 # common.txt is a one-off.
802 gentxt('common') 802 gentxt('common')
803 803
804 for source in sorted(sources): 804 for source in sorted(sources):
969 class hgbuildpy2exe(buildpy2exe): 969 class hgbuildpy2exe(buildpy2exe):
970 def find_needed_modules(self, mf, files, modules): 970 def find_needed_modules(self, mf, files, modules):
971 res = buildpy2exe.find_needed_modules(self, mf, files, modules) 971 res = buildpy2exe.find_needed_modules(self, mf, files, modules)
972 972
973 # Replace virtualenv's distutils modules with the real ones. 973 # Replace virtualenv's distutils modules with the real ones.
974 res.modules = { 974 modules = {}
975 k: v for k, v in res.modules.items() 975 for k, v in res.modules.items():
976 if k != 'distutils' and not k.startswith('distutils.')} 976 if k != 'distutils' and not k.startswith('distutils.'):
977 modules[k] = v
978
979 res.modules = modules
977 980
978 import opcode 981 import opcode
979 distutilsreal = os.path.join(os.path.dirname(opcode.__file__), 982 distutilsreal = os.path.join(os.path.dirname(opcode.__file__),
980 'distutils') 983 'distutils')
981 984