donors2csv: Check for import errors as early as possible.

This has to be done before argument parsing because that uses
import2ledger.strparse.
This commit is contained in:
Brett Smith 2018-06-01 11:13:21 -04:00
parent 2e2c783657
commit 8cffed1c68

View file

@ -740,8 +740,6 @@ def setup_logger(logger, loglevel, stream):
logger.setLevel(loglevel) logger.setLevel(loglevel)
def main(arglist=None, stdout=sys.stdout, stderr=sys.stderr): def main(arglist=None, stdout=sys.stdout, stderr=sys.stderr):
args = parse_arguments(arglist)
if ENTITY_HOOK is None: if ENTITY_HOOK is None:
print( print(
"Error: Failed to find the import2ledger module for supporting code.", "Error: Failed to find the import2ledger module for supporting code.",
@ -752,6 +750,7 @@ def main(arglist=None, stdout=sys.stdout, stderr=sys.stderr):
) )
return 4 return 4
args = parse_arguments(arglist)
setup_logger(logger, args.loglevel, stderr) setup_logger(logger, args.loglevel, stderr)
payees = PayeeCache() payees = PayeeCache()