Skip to content

Commit

Permalink
Fix 'truth value of array is ambiguous' error
Browse files Browse the repository at this point in the history
  • Loading branch information
sergioburdisso committed Feb 27, 2020
1 parent 40bb007 commit 86a0189
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pyss3/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def __do_get_doc__(sock, file):
doc = fdoc.readline()
line += 1
elif ":x_test:" in file:
if Server.__x_test__:
if Server.__x_test__ is not None:
idoc = int(file.split(":x_test:")[1])
doc = Server.__x_test__[idoc]
else:
Expand Down Expand Up @@ -492,8 +492,8 @@ def serve(
if Server.__server_socket__ is None:
Server.start_listening(port)

if x_test:
if y_test and len(y_test) == len(x_test):
if x_test is not None:
if y_test is not None and len(y_test) == len(x_test):
Server.set_testset(x_test, y_test)
else:
Print.error("y_test must have the same length as x_test")
Expand Down

0 comments on commit 86a0189

Please sign in to comment.