From 0df419394b49251b2021def05e820ab234d1ec74 Mon Sep 17 00:00:00 2001 From: alstr Date: Fri, 20 Mar 2020 14:08:18 +0000 Subject: [PATCH] Wrap diff in file --- main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 258927a..d8f4d9d 100644 --- a/main.py +++ b/main.py @@ -6,7 +6,7 @@ import requests import re import json from time import sleep - +from io import StringIO base_url = 'https://api.github.com/repos/' @@ -43,7 +43,7 @@ def main(): closed_issues = [] # Read the diff file one line at a time, checking for additions/deletions in each hunk. - with open(diff, 'r') as diff_file: + with StringIO(diff) as diff_file: curr_file = None hunk_start = None hunk_index = None