Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
9342187b
Commit
9342187b
authored
May 17, 2009
by
Tarek Ziadé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed sys.platform == 'mac' usage in distutils.dir_util
parent
f05e22fc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
11 deletions
+14
-11
dir_util.py
dir_util.py
+4
-7
tests/test_dir_util.py
tests/test_dir_util.py
+10
-4
No files found.
dir_util.py
View file @
9342187b
...
@@ -212,14 +212,11 @@ def remove_tree (directory, verbose=1, dry_run=0):
...
@@ -212,14 +212,11 @@ def remove_tree (directory, verbose=1, dry_run=0):
exc
,
"error removing %s: "
%
directory
))
exc
,
"error removing %s: "
%
directory
))
def
ensure_relative
(
path
):
def
ensure_relative
(
path
):
"""Take the full path 'path', and make it a relative path so
"""Take the full path 'path', and make it a relative path so
it can be the second argument to os.path.join().
it can be the second argument to os.path.join().
"""
"""
drive
,
path
=
os
.
path
.
splitdrive
(
path
)
drive
,
path
=
os
.
path
.
splitdrive
(
path
)
if
sys
.
platform
==
'mac'
:
return
os
.
sep
+
path
else
:
if
path
[
0
:
1
]
==
os
.
sep
:
if
path
[
0
:
1
]
==
os
.
sep
:
path
=
drive
+
path
[
1
:]
path
=
drive
+
path
[
1
:]
return
path
return
path
tests/test_dir_util.py
View file @
9342187b
...
@@ -3,10 +3,8 @@ import unittest
...
@@ -3,10 +3,8 @@ import unittest
import
os
import
os
import
shutil
import
shutil
from
distutils.dir_util
import
mkpath
from
distutils.dir_util
import
(
mkpath
,
remove_tree
,
create_tree
,
copy_tree
,
from
distutils.dir_util
import
remove_tree
ensure_relative
)
from
distutils.dir_util
import
create_tree
from
distutils.dir_util
import
copy_tree
from
distutils
import
log
from
distutils
import
log
from
distutils.tests
import
support
from
distutils.tests
import
support
...
@@ -85,6 +83,14 @@ class DirUtilTestCase(support.TempdirManager, unittest.TestCase):
...
@@ -85,6 +83,14 @@ class DirUtilTestCase(support.TempdirManager, unittest.TestCase):
remove_tree
(
self
.
root_target
,
verbose
=
0
)
remove_tree
(
self
.
root_target
,
verbose
=
0
)
remove_tree
(
self
.
target2
,
verbose
=
0
)
remove_tree
(
self
.
target2
,
verbose
=
0
)
def
test_ensure_relative
(
self
):
if
os
.
sep
==
'/'
:
self
.
assertEquals
(
ensure_relative
(
'/home/foo'
),
'home/foo'
)
self
.
assertEquals
(
ensure_relative
(
'some/path'
),
'some/path'
)
else
:
# \\
self
.
assertEquals
(
ensure_relative
(
'c:
\
\
home
\
\
foo'
),
'home
\
\
foo'
)
self
.
assertEquals
(
ensure_relative
(
'home
\
\
foo'
),
'home
\
\
foo'
)
def
test_suite
():
def
test_suite
():
return
unittest
.
makeSuite
(
DirUtilTestCase
)
return
unittest
.
makeSuite
(
DirUtilTestCase
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment