Fix error with symlinks when building the wheel on Linux

This commit is contained in:
Robin Dunn
2020-04-12 19:25:10 -07:00
committed by Robin Dunn
parent cc88ed14d9
commit aa8430ad39
2 changed files with 12 additions and 1 deletions

View File

@@ -1,3 +1,3 @@
# This file was generated by wxPython's wscript.
VERSION_STRING = '4.1.0a1'
VERSION_STRING = '4.1.0'

View File

@@ -11,6 +11,7 @@
import sys, os
import glob
import stat
from setuptools import setup, find_packages
from distutils.command.build import build as orig_build
@@ -308,6 +309,16 @@ orig_copy_tree = distutils.dir_util.copy_tree
distutils.dir_util.copy_tree = wx_copy_tree
# Monkey-patch make_writeable too. Sometimes the link is copied before the
# target, and the original make_writable will fail on a link to a missing
# target.
def wx_make_writable(target):
if not os.path.islink(target):
os.chmod(target, os.stat(target).st_mode | stat.S_IWRITE)
import setuptools.command.build_py
setuptools.command.build_py.make_writable = wx_make_writable
#----------------------------------------------------------------------