Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ab3a0f3

Browse files
committed
Fixed imports from '*util' modules to not just import everything from util.
1 parent 5a8aa1b commit ab3a0f3

7 files changed

Lines changed: 18 additions & 16 deletions

File tree

Lib/distutils/command/bdist_dumb.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010

1111
import os
1212
from distutils.core import Command
13-
from distutils.util import get_platform, create_tree, remove_tree
13+
from distutils.util import get_platform
14+
from distutils.dir_util import create_tree, remove_tree
1415
from distutils.errors import *
1516

1617
class bdist_dumb (Command):

Lib/distutils/command/bdist_rpm.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
import os, string
1111
from types import *
1212
from distutils.core import Command, DEBUG
13-
from distutils.util import get_platform, write_file
13+
from distutils.util import get_platform
14+
from distutils.file_util import write_file
1415
from distutils.errors import *
1516

1617
class bdist_rpm (Command):

Lib/distutils/command/bdist_wininst.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99

1010
import sys, os, string
1111
from distutils.core import Command
12-
from distutils.util import get_platform, create_tree, remove_tree
12+
from distutils.util import get_platform
13+
from distutils.dir_util import create_tree, remove_tree
1314
from distutils.errors import *
1415

1516
class bdist_wininst (Command):

Lib/distutils/command/clean.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import os
1010
from distutils.core import Command
11-
from distutils.util import remove_tree
11+
from distutils.dir_util import remove_tree
1212

1313
class clean (Command):
1414

Lib/distutils/command/install.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
from types import *
1111
from distutils.core import Command, DEBUG
1212
from distutils import sysconfig
13-
from distutils.util import write_file, convert_path, subst_vars, change_root
13+
from distutils.file_util import write_file
14+
from distutils.util import convert_path, subst_vars, change_root
1415
from distutils.errors import DistutilsOptionError
1516
from glob import glob
1617

Lib/distutils/command/install_lib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import sys, os, string
66
from distutils.core import Command
7-
from distutils.util import copy_tree
7+
from distutils.dir_util import copy_tree
88

99
class install_lib (Command):
1010

Lib/distutils/command/sdist.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010
from types import *
1111
from glob import glob
1212
from distutils.core import Command
13-
from distutils.util import \
14-
create_tree, remove_tree, newer, write_file, \
15-
check_archive_formats
13+
from distutils import dir_util, dep_util, file_util, archive_util
1614
from distutils.text_file import TextFile
1715
from distutils.errors import *
1816
from distutils.filelist import FileList
@@ -117,7 +115,7 @@ def finalize_options (self):
117115
"don't know how to create source distributions " + \
118116
"on platform %s" % os.name
119117

120-
bad_format = check_archive_formats (self.formats)
118+
bad_format = archive_util.check_archive_formats (self.formats)
121119
if bad_format:
122120
raise DistutilsOptionError, \
123121
"unknown archive format '%s'" % bad_format
@@ -195,7 +193,7 @@ def get_file_list (self):
195193
# manifest; if so, we'll regenerate the manifest.
196194
template_exists = os.path.isfile(self.template)
197195
if template_exists:
198-
template_newer = newer(self.template, self.manifest)
196+
template_newer = dep_util.newer(self.template, self.manifest)
199197

200198
# The contents of the manifest file almost certainly depend on the
201199
# setup script as well as the manifest template -- so if the setup
@@ -204,7 +202,7 @@ def get_file_list (self):
204202
# manifest, but there's no template -- which will happen if the
205203
# developer elects to generate a manifest some other way -- then we
206204
# can't regenerate the manifest, so we don't.)
207-
setup_newer = newer(sys.argv[0], self.manifest)
205+
setup_newer = dep_util.newer(sys.argv[0], self.manifest)
208206

209207
# cases:
210208
# 1) no manifest, template exists: generate manifest
@@ -368,7 +366,7 @@ def write_manifest (self):
368366
by 'add_defaults()' and 'read_template()') to the manifest file
369367
named by 'self.manifest'.
370368
"""
371-
self.execute(write_file,
369+
self.execute(file_util.write_file,
372370
(self.manifest, self.filelist.files),
373371
"writing manifest file '%s'" % self.manifest)
374372

@@ -404,8 +402,8 @@ def make_release_tree (self, base_dir, files):
404402
"""
405403
# Create all the directories under 'base_dir' necessary to
406404
# put 'files' there.
407-
create_tree (base_dir, files,
408-
verbose=self.verbose, dry_run=self.dry_run)
405+
dir_util.create_tree (base_dir, files,
406+
verbose=self.verbose, dry_run=self.dry_run)
409407

410408
# And walk over the list of files, either making a hard link (if
411409
# os.link exists) to each one that doesn't already exist in its
@@ -453,7 +451,7 @@ def make_distribution (self):
453451
self.archive_files = archive_files
454452

455453
if not self.keep_tree:
456-
remove_tree (base_dir, self.verbose, self.dry_run)
454+
dir_util.remove_tree (base_dir, self.verbose, self.dry_run)
457455

458456
def get_archive_files (self):
459457
"""Return the list of archive files created when the command

0 commit comments

Comments
 (0)