mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Fix deprecated logger warning for Python 3
logger.warn() has been deprecated in Python 3 in favor of logger.warning()
This commit is contained in:
parent
cfd18b20fc
commit
80842cbc0e
1 changed files with 3 additions and 3 deletions
|
|
@ -135,7 +135,7 @@ def wp2fields(xml, wp_custpost=False):
|
||||||
title = HTMLParser().unescape(item.title.contents[0])
|
title = HTMLParser().unescape(item.title.contents[0])
|
||||||
except IndexError:
|
except IndexError:
|
||||||
title = 'No title [%s]' % item.find('post_name').string
|
title = 'No title [%s]' % item.find('post_name').string
|
||||||
logger.warn('Post "%s" is lacking a proper title' % title)
|
logger.warning('Post "%s" is lacking a proper title' % title)
|
||||||
|
|
||||||
filename = item.find('post_name').string
|
filename = item.find('post_name').string
|
||||||
post_id = item.find('post_id').string
|
post_id = item.find('post_id').string
|
||||||
|
|
@ -601,11 +601,11 @@ def download_attachments(output_path, urls):
|
||||||
except URLError as e:
|
except URLError as e:
|
||||||
error = ("No file could be downloaded from {}; Error {}"
|
error = ("No file could be downloaded from {}; Error {}"
|
||||||
.format(url, e))
|
.format(url, e))
|
||||||
logger.warn(error)
|
logger.warning(error)
|
||||||
except IOError as e: #Python 2.7 throws an IOError rather Than URLError
|
except IOError as e: #Python 2.7 throws an IOError rather Than URLError
|
||||||
error = ("No file could be downloaded from {}; Error {}"
|
error = ("No file could be downloaded from {}; Error {}"
|
||||||
.format(url, e))
|
.format(url, e))
|
||||||
logger.warn(error)
|
logger.warning(error)
|
||||||
return locations
|
return locations
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue