Skip to content
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
6 changes: 5 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
--drifting Drifting mine.

"""
import os, sys, traceback, json
import os, sys, traceback, json, shlex
from StringIO import StringIO

from flask import Flask, render_template as render, request
Expand All @@ -27,6 +27,10 @@


def run_docopt(doc, argv):
try:
argv = shlex.split(argv)
Copy link
Member

Choose a reason for hiding this comment

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

This works but I think it's best to do the splitting elsewhere, so that run_docopt can accept a list of arguments, as is usual.

except ValueError:
pass
real_stdout, sys.stdout = sys.stdout, StringIO()
real_stderr, sys.stderr = sys.stderr, StringIO()
try:
Expand Down