summaryrefslogtreecommitdiff
path: root/dev-python/lxml/files/gtk-threading-filename-guessing.patch
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/lxml/files/gtk-threading-filename-guessing.patch')
-rw-r--r--dev-python/lxml/files/gtk-threading-filename-guessing.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/dev-python/lxml/files/gtk-threading-filename-guessing.patch b/dev-python/lxml/files/gtk-threading-filename-guessing.patch
new file mode 100644
index 0000000..a48f258
--- /dev/null
+++ b/dev-python/lxml/files/gtk-threading-filename-guessing.patch
@@ -0,0 +1,35 @@
+=== src/lxml/apihelpers.pxi
+==================================================================
+--- src/lxml/apihelpers.pxi (revision 3804)
++++ src/lxml/apihelpers.pxi (revision 3805)
+@@ -1107,20 +1107,16 @@
+ Returns None if not a file object.
+ """
+ # file instances have a name attribute
+- try:
+- return source.name
+- except AttributeError:
+- pass
++ filename = getattr3(source, 'name', None)
++ if filename is not None:
++ return filename
+ # gzip file instances have a filename attribute
+- try:
+- return source.filename
+- except AttributeError:
+- pass
++ filename = getattr3(source, 'filename', None)
++ if filename is not None:
++ return filename
+ # urllib2 provides a geturl() method
+- try:
+- geturl = source.geturl
+- except AttributeError:
+- # can't determine filename
+- return None
+- else:
++ geturl = getattr3(source, 'geturl', None)
++ if geturl is not None:
+ return geturl()
++ # can't determine filename
++ return None