mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
remove unittest2 and fix various warnings in py3
This commit is contained in:
parent
091007ddf7
commit
bc4bd773a0
10 changed files with 76 additions and 61 deletions
|
|
@ -102,7 +102,9 @@ def wp2fields(xml):
|
|||
'"BeautifulSoup4" and "lxml" required to import Wordpress XML files.')
|
||||
sys.exit(error)
|
||||
|
||||
xmlfile = open(xml, encoding='utf-8').read()
|
||||
|
||||
with open(xml, encoding='utf-8') as infile:
|
||||
xmlfile = infile.read()
|
||||
soup = BeautifulSoup(xmlfile, "xml")
|
||||
items = soup.rss.channel.findAll('item')
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue