summaryrefslogtreecommitdiff
path: root/sleekxmpp/jid.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-07-30 09:08:58 -0700
committerLance Stout <lancestout@gmail.com>2012-07-30 09:08:58 -0700
commit44ce01a70b7926a1e1f4af6692be3bdc671f7318 (patch)
treec6992b7420f3731cea595b4d382c2d2987a7554a /sleekxmpp/jid.py
parentc2189b4ecd6b022ed9900a6f411bd7e9d57c47ce (diff)
parente4b4c676379df30d268d28341b643cd9cd10eb22 (diff)
downloadslixmpp-44ce01a70b7926a1e1f4af6692be3bdc671f7318.tar.gz
slixmpp-44ce01a70b7926a1e1f4af6692be3bdc671f7318.tar.bz2
slixmpp-44ce01a70b7926a1e1f4af6692be3bdc671f7318.tar.xz
slixmpp-44ce01a70b7926a1e1f4af6692be3bdc671f7318.zip
Merge branch 'master' into develop
Diffstat (limited to 'sleekxmpp/jid.py')
-rw-r--r--sleekxmpp/jid.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/sleekxmpp/jid.py b/sleekxmpp/jid.py
index 9e9c0d0b..015d95f8 100644
--- a/sleekxmpp/jid.py
+++ b/sleekxmpp/jid.py
@@ -29,7 +29,9 @@ ILLEGAL_CHARS = '\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r' + \
#: The basic regex pattern that a JID must match in order to determine
#: the local, domain, and resource parts. This regex does NOT do any
#: validation, which requires application of nodeprep, resourceprep, etc.
-JID_PATTERN = "^(?:([^\"&'/:<>@]{1,1023})@)?([^/@]{1,1023})(?:/(.{1,1023}))?$"
+JID_PATTERN = re.compile(
+ "^(?:([^\"&'/:<>@]{1,1023})@)?([^/@]{1,1023})(?:/(.{1,1023}))?$"
+)
#: The set of escape sequences for the characters not allowed by nodeprep.
JID_ESCAPE_SEQUENCES = set(['\\20', '\\22', '\\26', '\\27', '\\2f',
@@ -118,7 +120,7 @@ def _parse_jid(data):
:returns: tuple of the validated local, domain, and resource strings
"""
- match = re.match(JID_PATTERN, data)
+ match = JID_PATTERN.match(data)
if not match:
raise InvalidJID('JID could not be parsed')