~mdw
/
stgit
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
16dcfb8
)
Fix infinite recursion on absolute paths
author
Karl Hasselström
<kha@treskal.com>
Wed, 24 May 2006 06:06:43 +0000
(08:06 +0200)
committer
Catalin Marinas
<catalin.marinas@gmail.com>
Wed, 24 May 2006 20:57:34 +0000
(21:57 +0100)
Calling create_dirs with an absolute path caused infinite recursion,
since os.path.dirname('/') == '/'. Fix this by exiting early if the
given path already is a directory.
stgit/utils.py
patch
|
blob
|
blame
|
history
diff --git
a/stgit/utils.py
b/stgit/utils.py
index
68b8f58
..
ed6e43c
100644
(file)
--- a/
stgit/utils.py
+++ b/
stgit/utils.py
@@
-130,7
+130,7
@@
def remove_file_and_dirs(basedir, file):
def create_dirs(directory):
"""Create the given directory, if the path doesn't already exist."""
- if directory:
+ if directory
and not os.path.isdir(directory)
:
create_dirs(os.path.dirname(directory))
try:
os.mkdir(directory)