Permalink
Browse files

Fix up report_issue.py

Allow it to take non-file names for the traceback file. This allows users
without a traceback file to submit issues.
  • Loading branch information...
1 parent 16c4328 commit 7c172b733a023d87f45a59589283f544e7f52d19 @sigmavirus24 committed Jan 19, 2013
Showing with 6 additions and 2 deletions.
  1. +6 −2 report_issue.py
View
@@ -1,5 +1,6 @@
#!/usr/bin/env python
import sys
+import os
from github3 import login
from getpass import getpass
@@ -47,7 +48,8 @@ def prompt_user(prompt_str):
traceback = None
if issue_type.lower() == 'bug':
tb_file = prompt_user('Filename with traceback: ')
- traceback = open(tb_file).read()
+ if os.path.isfile(tb_file):
+ traceback = open(tb_file).read()
description = prompt_user('Description: ')
@@ -70,4 +72,6 @@ def prompt_user(prompt_str):
*Generated with github3.py using the report_issue script*
""".format(issue_type, traceback, description)
-repo.create_issue(title, body)
+i = repo.create_issue(title, body)
+
+print(i.html_url)

0 comments on commit 7c172b7

Please sign in to comment.