mirror of https://github.com/scrapy/scrapy.git
python2 compatible
This commit is contained in:
parent
56bff528e5
commit
ee4539b68d
|
|
@ -2,6 +2,7 @@
|
|||
Scheduler queues
|
||||
"""
|
||||
|
||||
import errno
|
||||
import marshal
|
||||
import os
|
||||
import os.path
|
||||
|
|
@ -17,7 +18,10 @@ def _with_mkdir(queue_class):
|
|||
class DirectoriesCreated(queue_class):
|
||||
|
||||
def __init__(self, path, *args, **kwargs):
|
||||
os.makedirs(os.path.dirname(path), exist_ok=True)
|
||||
dirname = os.path.dirname(path)
|
||||
if not os.path.exists(dirname):
|
||||
os.makedirs(dirname)
|
||||
|
||||
super(DirectoriesCreated, self).__init__(path, *args, **kwargs)
|
||||
|
||||
return DirectoriesCreated
|
||||
|
|
|
|||
Loading…
Reference in New Issue