Skip to content

Commit c59ac95

Browse files
committed
Fix setup-app command
1 parent 86f630e commit c59ac95

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

gearbox/commands/setup_app.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,17 +92,15 @@ def _setup_config(self, dist, filename, section, vars, verbosity):
9292

9393
if not modules:
9494
print("No modules are listed in top_level.txt")
95-
print("Try running python setup.py egg_info to regenerate that file")
95+
print("Try reinstalling the application to regenerate that file")
9696

97+
websetup_executed = False
9798
for mod_name in modules:
9899
mod_name = mod_name + ".websetup"
99100
try:
100101
mod = self._import_module(mod_name)
101-
except ImportError as e:
102+
except ModuleNotFoundError as e:
102103
print(e)
103-
desc = getattr(e, "args", ["No module named websetup"])[0]
104-
if not desc.startswith("No module named websetup"):
105-
raise
106104
mod = None
107105

108106
if mod is None:
@@ -111,17 +109,22 @@ def _setup_config(self, dist, filename, section, vars, verbosity):
111109
if hasattr(mod, "setup_app"):
112110
if verbosity:
113111
print("Running setup_app() from %s" % mod_name)
112+
websetup_executed = True
114113
self._call_setup_app(mod.setup_app, filename, section, vars)
115114
elif hasattr(mod, "setup_config"):
116115
if verbosity:
117116
print("Running setup_config() from %s" % mod_name)
117+
websetup_executed = True
118118
mod.setup_config(None, filename, section, vars)
119119
else:
120120
print(
121121
"No setup_app() or setup_config() function in %s (%s)"
122122
% (mod.__name__, mod.__file__)
123123
)
124124

125+
if not websetup_executed:
126+
print("No websetup found in any of the top modules")
127+
125128
def _call_setup_app(self, func, filename, section, vars):
126129
filename = os.path.abspath(filename)
127130
if ":" in section:

0 commit comments

Comments
 (0)