python: refresh patches
[openwrt/svn-archive/archive.git] / lang / python / patches / 040-dont-import-cross-compiled-modules.patch
1 ---
2 setup.py | 30 ------------------------------
3 1 file changed, 30 deletions(-)
4
5 --- Python-2.6.4.orig/setup.py
6 +++ Python-2.6.4/setup.py
7 @@ -270,36 +270,6 @@ class PyBuildExt(build_ext):
8 ext_filename = os.path.join(
9 self.build_lib,
10 self.get_ext_filename(self.get_ext_fullname(ext.name)))
11 - try:
12 - imp.load_dynamic(ext.name, ext_filename)
13 - except ImportError, why:
14 - self.failed.append(ext.name)
15 - self.announce('*** WARNING: renaming "%s" since importing it'
16 - ' failed: %s' % (ext.name, why), level=3)
17 - assert not self.inplace
18 - basename, tail = os.path.splitext(ext_filename)
19 - newname = basename + "_failed" + tail
20 - if os.path.exists(newname):
21 - os.remove(newname)
22 - os.rename(ext_filename, newname)
23 -
24 - # XXX -- This relies on a Vile HACK in
25 - # distutils.command.build_ext.build_extension(). The
26 - # _built_objects attribute is stored there strictly for
27 - # use here.
28 - # If there is a failure, _built_objects may not be there,
29 - # so catch the AttributeError and move on.
30 - try:
31 - for filename in self._built_objects:
32 - os.remove(filename)
33 - except AttributeError:
34 - self.announce('unable to remove files (ignored)')
35 - except:
36 - exc_type, why, tb = sys.exc_info()
37 - self.announce('*** WARNING: importing extension "%s" '
38 - 'failed with %s: %s' % (ext.name, exc_type, why),
39 - level=3)
40 - self.failed.append(ext.name)
41
42 def get_platform(self):
43 # Get value of sys.platform