From 0c09ecb038e1a336aeccc79a1482640583caccb9 Mon Sep 17 00:00:00 2001 From: Machinexa2 <60662297+machinexa2@users.noreply.github.com> Date: Sun, 30 Aug 2020 18:59:01 +0545 Subject: [PATCH] The previous fix caused an error thats why new fix https://github.com/codingo/Interlace/issues/115 I didnt expect the target_file to come as io.TextIOWrapper but i thought it would come as filename. And this fixes it. Also, this time there's no error because i tested it locally on my pc., --- Interlace/lib/core/input.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Interlace/lib/core/input.py b/Interlace/lib/core/input.py index c058750..f83dd9d 100644 --- a/Interlace/lib/core/input.py +++ b/Interlace/lib/core/input.py @@ -1,5 +1,6 @@ import os.path import sys +from io import TextIOWrapper from argparse import ArgumentParser from math import ceil from random import sample, choice @@ -252,7 +253,7 @@ class InputHelper(object): ranges.add(arguments.target) else: target_file = arguments.target_list - if not os.path.exists(target_file): + if not isinstance(target_file, TextIOWrapper): if not sys.stdin.isatty(): target_file = sys.stdin ranges.update([target.strip() for target in target_file if target.strip()])