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.,
This commit is contained in:
Machinexa2
2020-08-30 18:59:01 +05:45
committed by GitHub
parent 5a42a74de2
commit 0c09ecb038

View File

@@ -1,5 +1,6 @@
import os.path import os.path
import sys import sys
from io import TextIOWrapper
from argparse import ArgumentParser from argparse import ArgumentParser
from math import ceil from math import ceil
from random import sample, choice from random import sample, choice
@@ -252,7 +253,7 @@ class InputHelper(object):
ranges.add(arguments.target) ranges.add(arguments.target)
else: else:
target_file = arguments.target_list target_file = arguments.target_list
if not os.path.exists(target_file): if not isinstance(target_file, TextIOWrapper):
if not sys.stdin.isatty(): if not sys.stdin.isatty():
target_file = sys.stdin target_file = sys.stdin
ranges.update([target.strip() for target in target_file if target.strip()]) ranges.update([target.strip() for target in target_file if target.strip()])