Skip to content

fixed two errors: #123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dev_server/bundle_local.py
Original file line number Diff line number Diff line change
@@ -45,8 +45,8 @@ def main():
# Get the dists in requirements.txt
dists = []
for line in open(options.requirements, 'r').readlines():
if line.strip() or line.startswith('#'):
pass
if line.strip() == '' or line.startswith('#'):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

obviously, this is wrong

continue
pkg = line.split('==')[0]

if pkg not in installed_dists:
5 changes: 3 additions & 2 deletions dev_server/dev_server.py
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@
from sae.util import search_file_bottom_up

from sae.channel import _channel_wrapper
import traceback

app_root = search_file_bottom_up('config.yaml')
if app_root is None:
@@ -173,8 +174,8 @@ def main(options):

try:
index = imp.load_source('index', 'index.wsgi')
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some IOError exception may be thrown during the import process, but that doesn't mean 'index.wsgi' doesn't exist.
directly print the traceback can help user figure out where the real bug is.

except IOError:
print >>sys.stderr, "Seems you don't have an index.wsgi"
except:
print >>sys.stderr, traceback.format_exc()
return
if not hasattr(index, 'application'):
print >>sys.stderr, "application not found in index.wsgi"