Skip to content

Commit

Permalink
Fixed issue #126
Browse files Browse the repository at this point in the history
  • Loading branch information
seyyedaliayati committed Jan 5, 2022
1 parent e8dd50f commit 2561255
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sbse/initialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,8 @@ def load_extract_method_candidates(self):
class_file = class_file[0].longname()
else:
continue
file_content = codecs.open(class_file, mode='r').read()
_bytes = open(class_file, mode='rb').read()
file_content = codecs.decode(_bytes, errors='strict')
lines_info = row[5]
for i in lines_info.split(")"):
if i == '':
Expand All @@ -687,6 +688,8 @@ def load_extract_method_candidates(self):
start = len(file_content[:char_number].split("\n"))
stop = len(file_content[:length].split("\n"))
lines += list(range(start, stop + 1))
lines = list(set(lines))
lines.sort()
candidates.append({
"file_path": class_file,
"lines": lines
Expand Down

0 comments on commit 2561255

Please sign in to comment.