Ticket #4244: setup3k.diff
| File setup3k.diff, 4.5 KB (added by loewis, 3 years ago) |
|---|
-
twisted/python/versions.py
209 209 formatFile = os.path.join(svn, 'format') 210 210 if os.path.exists(formatFile): 211 211 # It looks like a less-than-version-10 working copy. 212 format = file(formatFile).read().strip()212 format = open(formatFile).read().strip() 213 213 parser = getattr(self, '_parseSVNEntries_' + format, None) 214 214 else: 215 215 # It looks like a version-10-or-greater working copy, which … … 220 220 return 'Unknown' 221 221 222 222 entriesFile = os.path.join(svn, 'entries') 223 entries = file(entriesFile)223 entries = open(entriesFile) 224 224 try: 225 225 try: 226 226 return parser(entries) -
twisted/python/dist.py
12 12 from distutils import core 13 13 from distutils.core import Extension 14 14 15 try: 16 execfile 17 except NameError: 18 from twisted.python.compat3k import execfile 19 15 20 twisted_subprojects = ["conch", "lore", "mail", "names", 16 21 "news", "pair", "runner", "web", "web2", 17 22 "words", "vfs"] … … 277 282 for f in os.listdir(self.build_dir): 278 283 fpath=os.path.join(self.build_dir, f) 279 284 if not fpath.endswith(".py"): 280 try:285 if os.path.exists(fpath + ".py"): 281 286 os.unlink(fpath + ".py") 282 except EnvironmentError, e:283 if e.args[1]=='No such file or directory':284 pass285 287 os.rename(fpath, fpath + ".py") 286 288 287 289 -
twisted/python/compat3k.py
1 def execfile(filename, *args): 2 return exec(compile(open(filename).read(), filename, 'exec'), *args) -
twisted/python/compat.py
Eigenschaftsänderungen: twisted/python/compat3k.py ___________________________________________________________________ Hinzugefügt: svn:keywords + Id Hinzugefügt: svn:eol-style + native
135 135 'set_connect_state', 'set_accept_state', 136 136 'connect_ex', 'sendall'): 137 137 138 exec """def %s(self, *args):138 exec("""def %s(self, *args): 139 139 self._lock.acquire() 140 140 try: 141 141 return apply(self._ssl_conn.%s, args) 142 142 finally: 143 self._lock.release()\n""" % (f, f) 143 self._lock.release()\n""" % (f, f)) 144 144 sys.modules['OpenSSL.tsafe'] = tsafe 145 145 146 146 import operator -
setup.py
15 15 16 16 import sys, os 17 17 18 try: 19 execfile 20 except NameError: 21 from twisted.python.compat3k import execfile 18 22 19 23 def getExtensions(): 20 24 """ … … 81 85 try: 82 86 list(parse_requirements(requirements)) 83 87 except: 84 print """You seem to be running a very old version of setuptools.88 print("""You seem to be running a very old version of setuptools. 85 89 This version of setuptools has a bug parsing dependencies, so automatic 86 90 dependency resolution is disabled. 87 """ 91 """) 88 92 else: 89 93 setup_args['install_requires'] = requirements 90 94 setup_args['include_package_data'] = True 91 95 setup_args['zip_safe'] = False 96 if getattr(setuptools, '_distribute', False): # set to True in distribute 97 setup_args['use_2to3'] = True 98 if (3,1) <= sys.version_info < (3,2): 99 # fix_callable chokes on twisted/trial/test/test_pyunitcompat.py 100 # reported as http://bugs.python.org/issue7810 101 from distutils.util import Mixin2to3 102 import lib2to3.refactor 103 Mixin2to3.fixer_names = lib2to3.refactor.get_fixers_from_package('lib2to3.fixes') 104 Mixin2to3.fixer_names.remove('lib2to3.fixes.fix_callable') 92 105 setup(**setup_args) 93 106 94 107
