]> www.wagner.pp.ru Git - oss/ljdump.git/blobdiff - ljdump.py
now replace lj comm as well as lj-cut tags
[oss/ljdump.git] / ljdump.py
index 5cd095a6e619e464c020c436186419acde9c7d1c..7ec77f2689b3781d239d81c681d53a94f36374fe 100755 (executable)
--- a/ljdump.py
+++ b/ljdump.py
@@ -2,7 +2,7 @@
 #
 # ljdump.py - livejournal archiver
 # Greg Hewgill <greg@hewgill.com> http://hewgill.com
-# Version 1.4
+# Version 1.5
 #
 # LICENSE
 #
@@ -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: