Skip to content

Commit 3eb80bc

Browse files
Fix IndexError and line length issues in spotifycli.py for Python 3.13 (#89)
1 parent 43143c2 commit 3eb80bc

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

spotifycli/spotifycli.py

+19-4
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,25 @@ def start_shell():
109109
def add_arguments():
110110
parser = argparse.ArgumentParser(description=__doc__)
111111
for argument in get_arguments():
112-
arg_type = 'store' if argument[2] else 'store_true'
113-
parser.add_argument(argument[0], help=argument[1], action=arg_type)
114-
parser.add_argument("--client", action="store", dest="client",
115-
help="sets client's dbus name", default="spotify")
112+
if len(argument) > 2 and argument[2]:
113+
arg_type = 'store'
114+
else:
115+
arg_type = 'store_true'
116+
117+
parser.add_argument(
118+
argument[0],
119+
help=argument[1],
120+
action=arg_type
121+
)
122+
123+
parser.add_argument(
124+
"--client",
125+
action="store",
126+
dest="client",
127+
help="sets client's dbus name",
128+
default="spotify"
129+
)
130+
116131
return parser.parse_args()
117132

118133

0 commit comments

Comments
 (0)