mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Fix way to handle OSError (error doesn't exist)
A better way would to use sys.stderr.write or PY3 print(file=sys.stderr)
This commit is contained in:
parent
c4f96b108f
commit
fec605b577
1 changed files with 3 additions and 2 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
import argparse
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
|
||||
from codecs import open
|
||||
|
|
@ -259,14 +260,14 @@ def main():
|
|||
elif args.feed:
|
||||
input_type = 'feed'
|
||||
else:
|
||||
print("you must provide either --wpfile, --dotclear or --feed options")
|
||||
print("You must provide either --wpfile, --dotclear or --feed options")
|
||||
exit()
|
||||
|
||||
if not os.path.exists(args.output):
|
||||
try:
|
||||
os.mkdir(args.output)
|
||||
except OSError:
|
||||
error("Couldn't create the output folder: " + args.output)
|
||||
print("Unable to create the output folder: " + args.output)
|
||||
exit()
|
||||
|
||||
# TODO: refactor this long assignment
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue