Skip to content

Commit 38c2d76

Browse files
authored
replacing clumsy typecheck with kwargs
1 parent 5c337b5 commit 38c2d76

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

heudiconv/utils.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -107,19 +107,8 @@ def anonymize_sid(sid, anon_sid_cmd):
107107
from subprocess import check_output
108108

109109
cmd = [anon_sid_cmd, sid]
110-
kwargs = {'encoding': 'utf-8'} if sys.version_info[0] >= 3 else {}
111-
return check_output(cmd, **kwargs).strip()
112-
113-
type_to_match = type(sid)
114-
type_returned = type(shell_return)
115-
116-
### Handle subprocess returning a bytes literal string to a python3 interpreter
117-
if all([sys.version_info[0] > 2, isinstance(shell_return, bytes), isinstance(sid, str)]):
118-
anon_sid = shell_return.decode()
119-
else:
120-
anon_sid = shell_return
121-
122-
return anon_sid.strip()
110+
kwargs = {'encoding': 'utf-8'} if sys.version_info[0] >= 3 else {}
111+
return check_output(cmd, **kwargs).strip()
123112

124113

125114
def create_file_if_missing(filename, content):

0 commit comments

Comments
 (0)