Skip to content

Commit 8e8c3ff

Browse files
committed
* ietf/tests.py: Remove filetime() again -- not using it.
* ietf/utils/soup2text.py: Do line ending normalization. - Legacy-Id: 315
1 parent 9a9f375 commit 8e8c3ff

2 files changed

Lines changed: 3 additions & 7 deletions

File tree

ietf/tests.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,6 @@ def filetext(filename):
7676
file.close()
7777
return chunk
7878

79-
def filetime(name):
80-
if os.path.exists(name):
81-
return os.stat(name)[stat.ST_MTIME]
82-
else:
83-
return 0
84-
8579
class UrlTestCase(TestCase):
8680
def setUp(self):
8781
from django.test.client import Client

ietf/utils/soup2text.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,10 @@ def __str__(self, encoding='latin-1',
9898
return str
9999

100100
def soup2text(html):
101+
# Line ending normalization
102+
html = html.replace("\r\n", "\n").replace("\r", "\n")
101103
# some preprocessing to handle common pathological cases
102-
html = re.sub("<br */?>[ \t\r\n]*(<br */?>)+", "<p/>", html)
104+
html = re.sub("<br */?>[ \t\n]*(<br */?>)+", "<p/>", html)
103105
soup = TextSoup(html)
104106
return str(soup)
105107

0 commit comments

Comments
 (0)