Permalink
Browse files

Add default username and password of "" to avoid Twisted cred error.

  • Loading branch information...
1 parent 177256c commit 3f42f37b0bdc6657f53a1f110d3776764bdd1dc3 @dripton committed May 31, 2012
Showing with 9 additions and 4 deletions.
  1. +4 −2 bin/stresstest-slugathon
  2. +5 −2 slugathon/ai/AIClient.py
View
@@ -67,8 +67,10 @@ def game_failed(arg):
def main():
parser = argparse.ArgumentParser(prog="stresstest-slugathon")
- parser.add_argument("-n", "--playername", action="store", type=str)
- parser.add_argument("-a", "--password", action="store", type=str)
+ parser.add_argument("-n", "--playername", action="store", type=str,
+ default="")
+ parser.add_argument("-a", "--password", action="store", type=str,
+ default="")
parser.add_argument("-s", "--start-server", action="store_true")
parser.add_argument("-g", "--num-games", action="store", type=int,
default=10000000)
View
@@ -605,8 +605,11 @@ def update(self, observed, action, names):
def add_arguments(parser):
- parser.add_argument("-n", "--playername", action="store", type=str)
- parser.add_argument("-a", "--password", action="store", type=str)
+ # Twisted throws a TypeError if username or password is None.
+ parser.add_argument("-n", "--playername", action="store", type=str,
+ default="")
+ parser.add_argument("-a", "--password", action="store", type=str,
+ default="")
parser.add_argument("-s", "--server", action="store", type=str,
default="localhost")
parser.add_argument("-p", "--port", action="store", type=int,

0 comments on commit 3f42f37

Please sign in to comment.