# HG changeset patch # User Ludovic Chabant # Date 1507188310 25200 # Node ID a85b2827ba1a0a6d17c1b448492149cb6785cfed # Parent 8ca228956cc66caaa7f257b891e7a129897e7cda prepare: Fix old API calls. diff -r 8ca228956cc6 -r a85b2827ba1a piecrust/commands/builtin/scaffolding.py --- a/piecrust/commands/builtin/scaffolding.py Thu Oct 05 00:24:44 2017 -0700 +++ b/piecrust/commands/builtin/scaffolding.py Thu Oct 05 00:25:10 2017 -0700 @@ -83,6 +83,8 @@ source = ctx.args.source content_item = source.createContent(vars(ctx.args)) + if content_item is None: + raise Exception("Can't create item.") config_tokens = { '%title%': "Untitled Content", @@ -97,7 +99,7 @@ logger.info("Creating content: %s" % content_item.spec) mode = 'w' if ctx.args.force else 'x' - with content_item.open(mode) as f: + with source.openItem(content_item, mode) as f: f.write(tpl_text) # If this was a file-system content item, see if we need to auto-open