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