[infrae.fileupload][Sylvain Viollon] Fix stupid mistake.

[email protected]
Newsgroups gmane.comp.web.zope.silva.cvs
Message-ID <[email protected]>
author:    Sylvain Viollon
date:      Tue Aug 13 14:54:01 2013 +0200
revision:  14:a09b9d442ede in infrae.fileupload
branch:    
details:   https://hg.infrae.com/infrae.fileupload?cmd=changeset;node=a09b9d442ede
modified:  src/infrae/fileupload/middleware.py
added:     
removed:   
log:       Fix stupid mistake.


diffstat:

 src/infrae/fileupload/middleware.py |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (27 lines):

diff -r 2d7dc1622770 -r a09b9d442ede src/infrae/fileupload/middleware.py
--- a/src/infrae/fileupload/middleware.py	Tue Aug 13 14:36:08 2013 +0200
+++ b/src/infrae/fileupload/middleware.py	Tue Aug 13 14:54:01 2013 +0200
@@ -23,11 +23,11 @@
 
     >>> compare(None)
     False
-    >>> compare('\n')
+    >>> compare('\\n')
     True
-    >>> compare('\r\n')
+    >>> compare('\\r\\n')
     True
-    >>> compare('foo\r\n')
+    >>> compare('foo\\r\\n')
     False
     >>> compare(None, 'foo')
     False
@@ -43,7 +43,7 @@
     False
     """
     if original and original.startswith(tested):
-        if tested[len(original):] in ('', '\r', '\n', '\r\n'):
+        if original[len(tested):] in ('', '\r', '\n', '\r\n'):
             return True
     return False
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.