瀏覽代碼

Override conf values with right type.

If the value overridden is int, convert new value to int as well.
Heikki Hokkanen 16 年之前
父節點
當前提交
13b04c093a
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4
    1
      gitstats

+ 4
- 1
gitstats 查看文件

@@ -1086,7 +1086,10 @@ class GitStats:
1086 1086
 				key, value = v.split('=', 1)
1087 1087
 				if key not in conf:
1088 1088
 					raise 'Error: no such key "%s" in config' % key
1089
-				conf[key] = value
1089
+				if isinstance(conf[key], int):
1090
+					conf[key] = int(value)
1091
+				else:
1092
+					conf[key] = value
1090 1093
 
1091 1094
 		if len(args) < 2:
1092 1095
 			print """