Log in

View Full Version : Python: TypeError: set_disabled() takes 1 positional argument?


team-4480
03-02-2015, 20:31
Hi! We are running into a problem with our code when we try to run the Pyfrc Sim. I am testing using some switches with DigitalInputs and I was checking for errors since I am out of reach of the robot. Code: http://pastebin.com/Es4z97GK. I get this error when running the sim. Traceback (most recent call last):
File "robot.py", line 84, in <module>
wpilib.run(MyRobot)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/wpilib/_impl/main.py", line 100, in run
retval = options.cmdobj.run(options, robot_class, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pyfrc/mains/cli_sim.py", line 46, in run
ui = sim.SimUI(sim_manager, fake_time, field_size, px_per_ft)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pyfrc/sim/ui.py", line 59, in __init__
self.timer_fired()
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pyfrc/sim/ui.py", line 329, in timer_fired
self.update_widgets()
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pyfrc/sim/ui.py", line 361, in update_widgets
dio.set_disabled(False)
TypeError: set_disabled() takes 1 positional argument but 2 were given Any help will be greatly appreciated!!

TimTheGreat
03-02-2015, 21:33
Update pyfrc

team-4480
03-02-2015, 22:03
Update pyfrc

Oh....that fixed it.....thanks! It really should be a "HumanError: Brain not found"!

TimTheGreat
03-02-2015, 22:11
It really should be a "HumanError: Brain not found"!

Well, until Dustin (virtualD) puts "Update pyfrc" into the error message there really isn't a way to know.

virtuald
03-02-2015, 23:14
Well, until Dustin (virtualD) puts "Update pyfrc" into the error message there really isn't a way to know.

Well, if I knew there was an error message, then I wouldn't have had the bug to begin with! :p

However, as Tim points out, if you run into a weird error, it's always best to make sure that you have the latest version -- especially this year, with so many new things for the new control system.