From 4134df821c69c1ebe13ab4bcb1d2a1f3cddbdd18 Mon Sep 17 00:00:00 2001From: river <riverfor@gmail.com>Date: 2018年8月11日 04:18:05 -0400Subject: [PATCH] python lib for qpy---Lib/distutils/command/build_scripts.py | 5 ++++-Lib/distutils/command/install_scripts.py | 5 ++++-Lib/distutils/file_util.py | 7 +++++--Lib/shutil.py | 10 ++++++++--Lib/subprocess.py | 2 +-5 files changed, 22 insertions(+), 7 deletions(-)diff --git a/Lib/distutils/command/build_scripts.py b/Lib/distutils/command/build_scripts.pyindex 567df65..2b5705a 100644--- a/Lib/distutils/command/build_scripts.py+++ b/Lib/distutils/command/build_scripts.py@@ -124,7 +124,10 @@ class build_scripts (Command):if newmode != oldmode:log.info("changing mode of %s from %o to %o",file, oldmode, newmode)- os.chmod(file, newmode)+ try:+ os.chmod(file, newmode)+ except OSError:+ pass# copy_scripts ()diff --git a/Lib/distutils/command/install_scripts.py b/Lib/distutils/command/install_scripts.pyindex 29cd9e7..f842309 100644--- a/Lib/distutils/command/install_scripts.py+++ b/Lib/distutils/command/install_scripts.py@@ -53,7 +53,10 @@ class install_scripts (Command):else:mode = ((os.stat(file)[ST_MODE]) | 0555) & 07777log.info("changing mode of %s to %o", file, mode)- os.chmod(file, mode)+ try:+ os.chmod(file, mode)+ except OSError:+ passdef get_inputs (self):return self.distribution.scripts or []diff --git a/Lib/distutils/file_util.py b/Lib/distutils/file_util.pyindex 3b236e1..c061282 100644--- a/Lib/distutils/file_util.py+++ b/Lib/distutils/file_util.py@@ -154,7 +154,7 @@ def copy_file(src, dst, preserve_mode=1, preserve_times=1, update=0,# Otherwise (non-Mac, not linking), copy the file contents and# (optionally) copy the times and mode._copy_file_contents(src, dst)- if preserve_mode or preserve_times:+ if False: #preserve_mode or preserve_times:st = os.stat(src)# According to David Ascher <da@ski.org>, utime() should be done@@ -162,7 +162,10 @@ def copy_file(src, dst, preserve_mode=1, preserve_times=1, update=0,if preserve_times:os.utime(dst, (st[ST_ATIME], st[ST_MTIME]))if preserve_mode:- os.chmod(dst, S_IMODE(st[ST_MODE]))+ try:+ os.chmod(dst, S_IMODE(st[ST_MODE]))+ except OSError:+ passreturn (dst, 1)diff --git a/Lib/shutil.py b/Lib/shutil.pyindex 3462f7c..fc8d203 100644--- a/Lib/shutil.py+++ b/Lib/shutil.py@@ -102,7 +102,10 @@ def copymode(src, dst):if hasattr(os, 'chmod'):st = os.stat(src)mode = stat.S_IMODE(st.st_mode)- os.chmod(dst, mode)+ try:+ os.chmod(dst, mode)+ except OSError:+ passdef copystat(src, dst):"""Copy all stat info (mode bits, atime, mtime, flags) from src to dst"""@@ -111,7 +114,10 @@ def copystat(src, dst):if hasattr(os, 'utime'):os.utime(dst, (st.st_atime, st.st_mtime))if hasattr(os, 'chmod'):- os.chmod(dst, mode)+ try:+ os.chmod(dst, mode)+ except OSError:+ passif hasattr(os, 'chflags') and hasattr(st, 'st_flags'):try:os.chflags(dst, st.st_flags)diff --git a/Lib/subprocess.py b/Lib/subprocess.pyindex 1f2da0f..7a74b42 100644--- a/Lib/subprocess.py+++ b/Lib/subprocess.py@@ -911,7 +911,7 @@ class Popen(object):args = list(args)if shell:- args = ["/bin/sh", "-c"] + args+ args = ["/system/bin/sh", "-c"] + argsif executable:args[0] = executable--2.7.4
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。