project.py: allow main to handle errors from west init

The handling code here is cutting out a lot of useful content that's
added by the exception handler in main.py, so there's no point in
having it.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
This commit is contained in:
Martí Bolívar 2019-11-27 17:05:58 -05:00 committed by Carles Cufí
parent b13a07e2b7
commit 49d348ce90
1 changed files with 2 additions and 8 deletions

View File

@ -20,8 +20,7 @@ from west.configuration import config, update_config
from west import log from west import log
from west import util from west import util
from west.commands import WestCommand, CommandError from west.commands import WestCommand, CommandError
from west.manifest import Manifest, MalformedManifest, MalformedConfig, \ from west.manifest import Manifest, MANIFEST_PROJECT_INDEX, ManifestProject
MANIFEST_PROJECT_INDEX, ManifestProject
from west.manifest import MANIFEST_REV_BRANCH as MANIFEST_REV from west.manifest import MANIFEST_REV_BRANCH as MANIFEST_REV
from west.manifest import QUAL_MANIFEST_REV_BRANCH as QUAL_MANIFEST_REV from west.manifest import QUAL_MANIFEST_REV_BRANCH as QUAL_MANIFEST_REV
from urllib.parse import urlparse from urllib.parse import urlparse
@ -289,12 +288,7 @@ class Init(_ProjectCommand):
return projects, manifest_project.abspath return projects, manifest_project.abspath
def projects(self, manifest_file): def projects(self, manifest_file):
try: return Manifest.from_file(manifest_file).projects
return Manifest.from_file(manifest_file).projects
except MalformedManifest as mm:
log.die(mm.args[0])
except MalformedConfig as mc:
log.die(mc.args[0])
def fixup_zephyr_base(self, projects): def fixup_zephyr_base(self, projects):
for project in projects: for project in projects: