]> wagner.pp.ru Git - oss/ljdump.git/blobdiff - ljdump.py
added regex to replace "lj user" tags with normal links.
[oss/ljdump.git] / ljdump.py
index b1c72d0c24e66f07bf9509b5256f042a6ff992f4..7ec77f2689b3781d239d81c681d53a94f36374fe 100755 (executable)
--- a/ljdump.py
+++ b/ljdump.py
@@ -241,7 +241,10 @@ def ljdump(Server, Username, Password, Journal):
                 print "*** Error fetching comment meta, possibly not community maintainer?"
                 break
         finally:
-            r.close()
+            try:
+                r.close()
+            except AttributeError: # r is sometimes a dict for unknown reasons
+                pass
         for c in meta.getElementsByTagName("comment"):
             id = int(c.getAttribute("id"))
             metacache[id] = {
@@ -376,3 +379,4 @@ if __name__ == "__main__":
             ljdump(server, username, password, journal)
         else:
             ljdump(server, username, password, username)
+# vim:ts=4 et: