Skip to content

Commit

Permalink
Fix up report_issue.py
Browse files Browse the repository at this point in the history
Allow it to take non-file names for the traceback file. This allows users
without a traceback file to submit issues.
  • Loading branch information
sigmavirus24 committed Jan 19, 2013
1 parent 16c4328 commit 7c172b7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions report_issue.py
@@ -1,5 +1,6 @@
#!/usr/bin/env python
import sys
import os
from github3 import login
from getpass import getpass

Expand Down Expand Up @@ -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: ')

Expand All @@ -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.