Skip to content

Commit ea8257f

Browse files
committed
Fix project template listing when none installed
If there are no project templates installed, show a nice message instead of a traceback from stevedore. Fixes issue #179
1 parent 2e16143 commit ea8257f

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

docs/source/history.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ dev
77
- Rename functions for generating help so they do not pollute the
88
global namespace, and especially so they do not interfere with tab
99
completion. Contributed by :bbuser:`davidszotten`.
10+
- Fix an issue with listing project templates if none are
11+
installed. (:bbissue:`179`)
1012

1113
3.7
1214

virtualenvwrapper/hook_loader.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,10 @@ def run_hooks(hook, options, args, output=None):
160160
def show(ext):
161161
output.write(' %-10s -- %s\n' %
162162
(ext.name, inspect.getdoc(ext.plugin) or ''))
163-
hook_mgr.map(show)
163+
try:
164+
hook_mgr.map(show)
165+
except RuntimeError: # no templates
166+
output.write(' No templates installed.\n')
164167

165168
elif options.sourcing:
166169
def get_source(ext, args):

0 commit comments

Comments
 (0)