cctool

A tool for managing contacts and calendars.
git clone https://git.ce9e.org/cctool.git

commit
89c2b50baf6768fc9466e8e13e8f644d2281aefc
parent
d5ea86b3543793a5548f21b315779c3e98ac27d8
Author
Tobias Bengfort <tobias.bengfort@gmx.net>
Date
2015-04-11 07:35
join: raise KeyError on missing default

Diffstat

M cctool.py 6 ++++--

1 files changed, 4 insertions, 2 deletions


diff --git a/cctool.py b/cctool.py

@@ -115,7 +115,7 @@ class MultiDict(OrderedDict):
  115   115 		elif default is not NOTSET:
  116   116 			return default
  117   117 		else:
  118    -1 			raise KeyError
   -1   118 			raise KeyError(key)
  119   119 
  120   120 	def join(self, key, default='', sep=u','):
  121   121 		if key in self:
@@ -123,8 +123,10 @@ class MultiDict(OrderedDict):
  123   123 				return self[key][0]
  124   124 			else:
  125   125 				return sep.join(self[key])
  126    -1 		else:
   -1   126 		elif default is not None:
  127   127 			return default
   -1   128 		else:
   -1   129 			raise KeyError(key)
  128   130 
  129   131 	def update(self, other):
  130   132 		for key in other: