Fix imports for Python 3

This commit is contained in:
Ivan Kozik 2014-03-18 11:13:51 +00:00
parent fa69d80b8d
commit f2839b727f

View File

@ -2,10 +2,13 @@
;;; Copyright (c) Paul R. Tagliamonte, 2013, MIT/Expat license. ;;; Copyright (c) Paul R. Tagliamonte, 2013, MIT/Expat license.
(import [urllib2 [urlopen]] (import [lxml [etree]]
[lxml [etree]]
[sys [argv]]) [sys [argv]])
(try
(import [urllib.request [urlopen]])
(catch [ImportError]
(import [urllib2 [urlopen]])))
(defn get-rss-feed-name [tumblr] (defn get-rss-feed-name [tumblr]
(kwapply (.format "http://{tumblr}.tumblr.com/rss") {"tumblr" tumblr})) (kwapply (.format "http://{tumblr}.tumblr.com/rss") {"tumblr" tumblr}))