py fixes
parent
706a21abe6
commit
112d35af71
|
@ -40,7 +40,7 @@ def question_timeperiod(request, question):
|
|||
|
||||
@answer_proc('timeperiod')
|
||||
def process_timeperiod(question, answer):
|
||||
if not answer['ANSWER'] or not 'unit in 'answer:
|
||||
if not answer['ANSWER'] or not 'unit' in answer:
|
||||
raise AnswerException(_(u"Invalid time period"))
|
||||
period = answer['ANSWER'].strip()
|
||||
if period:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/python
|
||||
import codecs
|
||||
import cStringIO
|
||||
from six import StringIO
|
||||
import csv
|
||||
from six import text_type as unicodestr
|
||||
|
||||
|
@ -71,7 +71,7 @@ class UnicodeWriter:
|
|||
|
||||
def __init__(self, f, dialect=csv.excel, encoding="utf-8", **kwds):
|
||||
# Redirect output to a queue
|
||||
self.queue = cStringIO.StringIO()
|
||||
self.queue = StringIO()
|
||||
self.writer = csv.writer(self.queue, dialect=dialect, **kwds)
|
||||
self.stream = f
|
||||
self.encoder = codecs.getincrementalencoder(encoding)()
|
||||
|
|
Loading…
Reference in New Issue