summary refs log tree commit diff
path: root/synapse/rest
diff options
context:
space:
mode:
authorAmber Brown <hawkowl@atleastfornow.net>2018-05-24 12:58:37 -0500
committerGitHub <noreply@github.com>2018-05-24 12:58:37 -0500
commit36501068d8f4d2e360b647b677cee99f91f8c4e6 (patch)
tree8f2353d312937f62a3dc0b60713625b18d4be332 /synapse/rest
parentMerge pull request #3245 from NotAFile/batch-iter (diff)
parentuse stand-in value if maxint is not available (diff)
downloadsynapse-36501068d8f4d2e360b647b677cee99f91f8c4e6.tar.xz
Merge pull request #3247 from NotAFile/py3-misc
Misc Python3 fixes
Diffstat (limited to 'synapse/rest')
-rw-r--r--synapse/rest/media/v1/preview_url_resource.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/synapse/rest/media/v1/preview_url_resource.py b/synapse/rest/media/v1/preview_url_resource.py
index 2839207abc..565cef2b8d 100644
--- a/synapse/rest/media/v1/preview_url_resource.py
+++ b/synapse/rest/media/v1/preview_url_resource.py
@@ -24,7 +24,9 @@ import shutil
 import sys
 import traceback
 import simplejson as json
-import urlparse
+
+from six.moves import urllib_parse as urlparse
+from six import string_types
 
 from twisted.web.server import NOT_DONE_YET
 from twisted.internet import defer
@@ -590,8 +592,8 @@ def _iterate_over_text(tree, *tags_to_ignore):
     # to be returned.
     elements = iter([tree])
     while True:
-        el = elements.next()
-        if isinstance(el, basestring):
+        el = next(elements)
+        if isinstance(el, string_types):
             yield el
         elif el is not None and el.tag not in tags_to_ignore:
             # el.text is the text before the first child, so we can immediately