Skip to content

Commit

Permalink
Fixes error in command line operation see Nickduino#25
Browse files Browse the repository at this point in the history
Fixes error massage in command line operation as mentioned by @Secarius  and @ssanden in Issue Nickduino#25
_Error in MyConfig:ReadValue: 0x279621: invalid literal for int() with base 10: 'None' : myconfig.py:160_

For the object _getint()_ None ist not an valid type. But None ist used as initial value in the config file
  • Loading branch information
firewiremb authored Aug 10, 2020
1 parent 6f14470 commit d4982d3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion myconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,10 @@ def ReadValue(self, Entry, return_type = str, default = None, section = None, No
elif return_type == float:
return self.config.getfloat(self.Section, Entry)
elif return_type == int:
return self.config.getint(self.Section, Entry)
if self.config.get(self.Section, Entry) == 'None':
return None
else:
return self.config.getint(self.Section, Entry)
else:
self.LogErrorLine("Error in MyConfig:ReadValue: invalid type:" + str(return_type))
return default
Expand Down

0 comments on commit d4982d3

Please sign in to comment.