summaryrefslogtreecommitdiff
path: root/django/utils
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2012-04-28 18:02:01 +0200
committerClaude Paroz <claude@2xlibre.net>2012-04-30 20:45:03 +0200
commit596cb9c7e287abbb98c64974fb4944d522cb6b5a (patch)
treee8ad5402dd233458b392d1822146bb1102ba74a6 /django/utils
parentfe43ad5707d116bb1729bc17a24ca16c90ae040d (diff)
Replaced print statement by print function (forward compatibility syntax).
Diffstat (limited to 'django/utils')
-rw-r--r--django/utils/dateformat.py2
-rw-r--r--django/utils/termcolors.py10
-rw-r--r--django/utils/unittest/main.py4
3 files changed, 8 insertions, 8 deletions
diff --git a/django/utils/dateformat.py b/django/utils/dateformat.py
index 1b2dd57fe7..e16a2df1f2 100644
--- a/django/utils/dateformat.py
+++ b/django/utils/dateformat.py
@@ -6,7 +6,7 @@ Usage:
>>> import datetime
>>> d = datetime.datetime.now()
>>> df = DateFormat(d)
->>> print df.format('jS F Y H:i')
+>>> print(df.format('jS F Y H:i'))
7th October 2003 11:39
>>>
"""
diff --git a/django/utils/termcolors.py b/django/utils/termcolors.py
index 4fb64ac9a0..1eebaa2316 100644
--- a/django/utils/termcolors.py
+++ b/django/utils/termcolors.py
@@ -33,10 +33,10 @@ def colorize(text='', opts=(), **kwargs):
colorize('hello', fg='red', bg='blue', opts=('blink',))
colorize()
colorize('goodbye', opts=('underscore',))
- print colorize('first line', fg='red', opts=('noreset',))
- print 'this should be red too'
- print colorize('and so should this')
- print 'this should not be red'
+ print(colorize('first line', fg='red', opts=('noreset',)))
+ print('this should be red too')
+ print(colorize('and so should this'))
+ print('this should not be red')
"""
code_list = []
if text == '' and len(opts) == 1 and opts[0] == 'reset':
@@ -59,7 +59,7 @@ def make_style(opts=(), **kwargs):
Example:
bold_red = make_style(opts=('bold',), fg='red')
- print bold_red('hello')
+ print(bold_red('hello'))
KEYWORD = make_style(fg='yellow')
COMMENT = make_style(fg='blue', opts=('bold',))
"""
diff --git a/django/utils/unittest/main.py b/django/utils/unittest/main.py
index 744cacd841..0f25a98a22 100644
--- a/django/utils/unittest/main.py
+++ b/django/utils/unittest/main.py
@@ -99,7 +99,7 @@ class TestProgram(object):
def usageExit(self, msg=None):
if msg:
- print msg
+ print(msg)
usage = {'progName': self.progName, 'catchbreak': '', 'failfast': '',
'buffer': ''}
if self.failfast != False:
@@ -108,7 +108,7 @@ class TestProgram(object):
usage['catchbreak'] = CATCHBREAK
if self.buffer != False:
usage['buffer'] = BUFFEROUTPUT
- print self.USAGE % usage
+ print(self.USAGE % usage)
sys.exit(2)
def parseArgs(self, argv):