mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
os.walk does not support followlinks kwargs in python 2.5
This commit is contained in:
parent
f3a8f45de4
commit
70ea12aec3
1 changed files with 14 additions and 8 deletions
|
|
@ -63,7 +63,13 @@ class Generator(object):
|
||||||
extensions = self.markup
|
extensions = self.markup
|
||||||
|
|
||||||
files = []
|
files = []
|
||||||
for root, dirs, temp_files in os.walk(path, followlinks=True):
|
|
||||||
|
try:
|
||||||
|
iter = os.walk(path, followlinks=True)
|
||||||
|
except TypeError: # python 2.5 does not support followlinks
|
||||||
|
iter = os.walk(path)
|
||||||
|
|
||||||
|
for root, dirs, temp_files in iter:
|
||||||
for e in exclude:
|
for e in exclude:
|
||||||
if e in dirs:
|
if e in dirs:
|
||||||
dirs.remove(e)
|
dirs.remove(e)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue