From fec605b5775f0f9dba6e78a99f99dddcf09b8b5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Raimbault?= Date: Tue, 13 Mar 2012 02:17:06 +0100 Subject: [PATCH] Fix way to handle OSError (error doesn't exist) A better way would to use sys.stderr.write or PY3 print(file=sys.stderr) --- tools/pelican_import.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/pelican_import.py b/tools/pelican_import.py index 14f06138..12c3597f 100755 --- a/tools/pelican_import.py +++ b/tools/pelican_import.py @@ -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