• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/package/python/python-003-properly-detect-if-python-build.patch
Thomas PetazzoniThomas Petazzoni committed 7e960dc9da513 Feb 2014
Raw file
Source viewDiff to previous
 
1
distutils: fix build_ext check to find whether we're building Python or not
2
​
3
The build_ext logic uses
4
sys.executable.startswith(os.path.join(sys.exec_prefix, "bin")) to
5
determine whether we're building a third-party Python extension, or a
6
built-in Python extension. However, this check is wrong in
7
cross-compilation mode, and instead, the sysconfig.python_build
8
variable should be used.
9
​
10
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
11
Index: b/Lib/distutils/command/build_ext.py
12
===================================================================
13
--- a/Lib/distutils/command/build_ext.py
14
+++ b/Lib/distutils/command/build_ext.py
15
@@ -235,7 +235,7 @@
16
         # Python's library directory must be appended to library_dirs
17
         # See Issues: #1600860, #4366
18
         if (sysconfig.get_config_var('Py_ENABLE_SHARED')):
19
-            if sys.executable.startswith(os.path.join(sys.exec_prefix, "bin")):
20
+            if not sysconfig.python_build:
21
                 # building third party extensions
22
                 self.library_dirs.append(sysconfig.get_config_var('LIBDIR'))
23
             else:
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.