X-Git-Url: http://git.maemo.org/git/?p=doneit;a=blobdiff_plain;f=src%2Frtm_api.py;fp=src%2Frtm_api.py;h=d275831f67ee54d0a37f650862f298805318bb14;hp=a1843284c44bc0c0f282131598b8ac2c59fadbf4;hb=fcaf2683b09cd338fceb38849733659d0063decb;hpb=e558d14d1c3f82647a67c399805420d5e55fd1ca diff --git a/src/rtm_api.py b/src/rtm_api.py index a184328..d275831 100644 --- a/src/rtm_api.py +++ b/src/rtm_api.py @@ -53,7 +53,7 @@ class AuthStateMachine(object): def dataReceived(self, state, datum): if state not in self.states: - raise RTMError, "Invalid state <%s>" % state + raise RTMError("Invalid state <%s>" % state) self.data[state] = datum def get(self, state): @@ -165,8 +165,12 @@ class RTMapi(object): rsp = data.rsp if rsp.stat == 'fail': - raise RTMAPIError, 'API call failed - %s (%s)' % ( - rsp.err.msg, rsp.err.code) + raise RTMAPIError( + 'API call failed - %s (%s)' % ( + rsp.err.msg, + rsp.err.code, + ) + ) else: return rsp @@ -206,7 +210,7 @@ class RTMAPICategory(object): def __getattr__(self, attr): if attr not in self._methods: - raise AttributeError, 'No such attribute: %s' % attr + raise AttributeError('No such attribute: %s' % attr) rargs, oargs = self._methods[attr] if self._prefix == 'tasksNotes': @@ -221,7 +225,7 @@ class RTMAPICategory(object): # Sanity checks for requiredArg in rargs: if requiredArg not in params: - raise TypeError, 'Required parameter (%s) missing' % requiredArg + raise TypeError('Required parameter (%s) missing' % requiredArg) for param in params: if param not in rargs + oargs: