From 112d35af715bf2787a06c5f5505fb7bd1fee0204 Mon Sep 17 00:00:00 2001 From: eric Date: Wed, 12 Feb 2020 15:31:14 -0500 Subject: [PATCH] py fixes --- questionnaire/qprocessors/timeperiod.py | 2 +- questionnaire/utils.py | 4 ++-- setup.py | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/questionnaire/qprocessors/timeperiod.py b/questionnaire/qprocessors/timeperiod.py index ff22316..7698398 100644 --- a/questionnaire/qprocessors/timeperiod.py +++ b/questionnaire/qprocessors/timeperiod.py @@ -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: diff --git a/questionnaire/utils.py b/questionnaire/utils.py index d058218..3b1bce0 100644 --- a/questionnaire/utils.py +++ b/questionnaire/utils.py @@ -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)() diff --git a/setup.py b/setup.py index db5c98b..eb4198b 100644 --- a/setup.py +++ b/setup.py @@ -29,11 +29,11 @@ setup( ], zip_safe=False, install_requires=[ - 'django', - 'django-transmeta', + 'django<2', + 'django-transmeta-eh', 'django-compat', 'pyyaml', - 'pyparsing' + 'pyparsing', 'six' ], setup_requires=[