mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Use list constructor or built-in method instead of copy module
This commit is contained in:
parent
ba661a9c39
commit
088025fc5b
3 changed files with 5 additions and 8 deletions
|
@ -48,7 +48,6 @@ of GCC (same as cygwin in no-cygwin mode).
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import copy
|
|
||||||
|
|
||||||
from packaging import logger
|
from packaging import logger
|
||||||
from packaging.compiler.unixccompiler import UnixCCompiler
|
from packaging.compiler.unixccompiler import UnixCCompiler
|
||||||
|
@ -172,9 +171,9 @@ class CygwinCCompiler(UnixCCompiler):
|
||||||
extra_postargs=None, build_temp=None, target_lang=None):
|
extra_postargs=None, build_temp=None, target_lang=None):
|
||||||
"""Link the objects."""
|
"""Link the objects."""
|
||||||
# use separate copies, so we can modify the lists
|
# use separate copies, so we can modify the lists
|
||||||
extra_preargs = copy.copy(extra_preargs or [])
|
extra_preargs = list(extra_preargs or [])
|
||||||
libraries = copy.copy(libraries or [])
|
libraries = list(libraries or [])
|
||||||
objects = copy.copy(objects or [])
|
objects = list(objects or [])
|
||||||
|
|
||||||
# Additional libraries
|
# Additional libraries
|
||||||
libraries.extend(self.dll_libraries)
|
libraries.extend(self.dll_libraries)
|
||||||
|
|
|
@ -5,7 +5,6 @@ import re
|
||||||
import sys
|
import sys
|
||||||
import getopt
|
import getopt
|
||||||
import logging
|
import logging
|
||||||
from copy import copy
|
|
||||||
|
|
||||||
from packaging import logger
|
from packaging import logger
|
||||||
from packaging.dist import Distribution
|
from packaging.dist import Distribution
|
||||||
|
@ -673,7 +672,7 @@ class Dispatcher:
|
||||||
|
|
||||||
def main(args=None):
|
def main(args=None):
|
||||||
old_level = logger.level
|
old_level = logger.level
|
||||||
old_handlers = copy(logger.handlers)
|
old_handlers = list(logger.handlers)
|
||||||
try:
|
try:
|
||||||
dispatcher = Dispatcher(args)
|
dispatcher = Dispatcher(args)
|
||||||
if dispatcher.action is None:
|
if dispatcher.action is None:
|
||||||
|
|
|
@ -14,7 +14,6 @@ import zipfile
|
||||||
import posixpath
|
import posixpath
|
||||||
import sysconfig
|
import sysconfig
|
||||||
import subprocess
|
import subprocess
|
||||||
from copy import copy
|
|
||||||
from glob import iglob as std_iglob
|
from glob import iglob as std_iglob
|
||||||
from fnmatch import fnmatchcase
|
from fnmatch import fnmatchcase
|
||||||
from inspect import getsource
|
from inspect import getsource
|
||||||
|
@ -384,7 +383,7 @@ byte_compile(files, optimize=%r, force=%r,
|
||||||
elif optimize == 2:
|
elif optimize == 2:
|
||||||
cmd.insert(1, "-OO")
|
cmd.insert(1, "-OO")
|
||||||
|
|
||||||
env = copy(os.environ)
|
env = os.environ.copy()
|
||||||
env['PYTHONPATH'] = os.path.pathsep.join(sys.path)
|
env['PYTHONPATH'] = os.path.pathsep.join(sys.path)
|
||||||
try:
|
try:
|
||||||
spawn(cmd, env=env)
|
spawn(cmd, env=env)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue