mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Merge pull request #842 from avaris/remove-unittest2
remove unittest2 and fix various warnings in py3
This commit is contained in:
commit
87735b5215
10 changed files with 75 additions and 66 deletions
|
|
@ -106,7 +106,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