diff options
author | Éric Araujo <merwok@netwok.org> | 2011-06-04 16:45:40 (GMT) |
---|---|---|
committer | Éric Araujo <merwok@netwok.org> | 2011-06-04 16:45:40 (GMT) |
commit | 088025fc5bb10711db53d16788c202e3852e3777 (patch) | |
tree | a22a656c25f78359c6469029f8356b41161924e7 | |
parent | ba661a9c398c1d75a036e0b56bba59ab7191eaa8 (diff) | |
download | cpython-088025fc5bb10711db53d16788c202e3852e3777.zip cpython-088025fc5bb10711db53d16788c202e3852e3777.tar.gz cpython-088025fc5bb10711db53d16788c202e3852e3777.tar.bz2 |
Use list constructor or built-in method instead of copy module
-rw-r--r-- | Lib/packaging/compiler/cygwinccompiler.py | 7 | ||||
-rw-r--r-- | Lib/packaging/run.py | 3 | ||||
-rw-r--r-- | Lib/packaging/util.py | 3 |
3 files changed, 5 insertions, 8 deletions
diff --git a/Lib/packaging/compiler/cygwinccompiler.py b/Lib/packaging/compiler/cygwinccompiler.py index 7bfa611..348dbe7 100644 --- a/Lib/packaging/compiler/cygwinccompiler.py +++ b/Lib/packaging/compiler/cygwinccompiler.py @@ -48,7 +48,6 @@ of GCC (same as cygwin in no-cygwin mode). import os import sys -import copy from packaging import logger from packaging.compiler.unixccompiler import UnixCCompiler @@ -172,9 +171,9 @@ class CygwinCCompiler(UnixCCompiler): extra_postargs=None, build_temp=None, target_lang=None): """Link the objects.""" # use separate copies, so we can modify the lists - extra_preargs = copy.copy(extra_preargs or []) - libraries = copy.copy(libraries or []) - objects = copy.copy(objects or []) + extra_preargs = list(extra_preargs or []) + libraries = list(libraries or []) + objects = list(objects or []) # Additional libraries libraries.extend(self.dll_libraries) diff --git a/Lib/packaging/run.py b/Lib/packaging/run.py index de9dd13..1895dde 100644 --- a/Lib/packaging/run.py +++ b/Lib/packaging/run.py @@ -5,7 +5,6 @@ import re import sys import getopt import logging -from copy import copy from packaging import logger from packaging.dist import Distribution @@ -673,7 +672,7 @@ class Dispatcher: def main(args=None): old_level = logger.level - old_handlers = copy(logger.handlers) + old_handlers = list(logger.handlers) try: dispatcher = Dispatcher(args) if dispatcher.action is None: diff --git a/Lib/packaging/util.py b/Lib/packaging/util.py index 4e5bd2c..748686d 100644 --- a/Lib/packaging/util.py +++ b/Lib/packaging/util.py @@ -14,7 +14,6 @@ import zipfile import posixpath import sysconfig import subprocess -from copy import copy from glob import iglob as std_iglob from fnmatch import fnmatchcase from inspect import getsource @@ -384,7 +383,7 @@ byte_compile(files, optimize=%r, force=%r, elif optimize == 2: cmd.insert(1, "-OO") - env = copy(os.environ) + env = os.environ.copy() env['PYTHONPATH'] = os.path.pathsep.join(sys.path) try: spawn(cmd, env=env) |