comparison src/browser/sat_browser/jid.py @ 575:f8a355bede6a

browser_side (jid): remove JID constructor special error handling (it's better to get the full backtrace)
author souliane <souliane@mailoo.org>
date Sat, 18 Oct 2014 13:54:13 +0200
parents b38629924602
children 0a06cf833f5a
comparison
equal deleted inserted replaced
574:b07f0fe2763a 575:f8a355bede6a
23 23
24 class JID(object): 24 class JID(object):
25 """This class help manage JID (Node@Domaine/Resource)""" 25 """This class help manage JID (Node@Domaine/Resource)"""
26 26
27 def __init__(self, jid): 27 def __init__(self, jid):
28 try: 28 assert(isinstance(jid, str))
29 assert(isinstance(jid, str))
30 except AssertionError:
31 raise AssertionError('Expected a string but got a %(class)s: %(inst)s' %
32 {'class': jid.__class__, 'inst': jid})
33 self.__raw = str(JID.__normalize(jid)) 29 self.__raw = str(JID.__normalize(jid))
34 self.__parse() 30 self.__parse()
35 31
36 @classmethod 32 @classmethod
37 def __normalize(cls, jid): 33 def __normalize(cls, jid):