aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/locale.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-02-09 05:37:30 +0000
committerGuido van Rossum <guido@python.org>2007-02-09 05:37:30 +0000
commitbe19ed77ddb047e02fe94d142181062af6d99dcc (patch)
tree70f214e06554046fcccbadeb78665f25e07ce965 /Lib/locale.py
parent452bf519a70c3db0e7f0d2540b1bfb07d9085583 (diff)
downloadcpython-be19ed77ddb047e02fe94d142181062af6d99dcc.tar.gz
cpython-be19ed77ddb047e02fe94d142181062af6d99dcc.zip
Fix most trivially-findable print statements.
There's one major and one minor category still unfixed: doctests are the major category (and I hope to be able to augment the refactoring tool to refactor bona fide doctests soon); other code generating print statements in strings is the minor category. (Oh, and I don't know if the compiler package works.)
Diffstat (limited to 'Lib/locale.py')
-rw-r--r--Lib/locale.py70
1 files changed, 35 insertions, 35 deletions
diff --git a/Lib/locale.py b/Lib/locale.py
index fd549bbde12..d3294ce6636 100644
--- a/Lib/locale.py
+++ b/Lib/locale.py
@@ -262,10 +262,10 @@ def _test():
setlocale(LC_ALL, "")
#do grouping
s1 = format("%d", 123456789,1)
- print s1, "is", atoi(s1)
+ print(s1, "is", atoi(s1))
#standard formatting
s1 = str(3.14)
- print s1, "is", atof(s1)
+ print(s1, "is", atof(s1))
### Locale name aliasing engine
@@ -1499,49 +1499,49 @@ def _print_locale():
_init_categories()
del categories['LC_ALL']
- print 'Locale defaults as determined by getdefaultlocale():'
- print '-'*72
+ print('Locale defaults as determined by getdefaultlocale():')
+ print('-'*72)
lang, enc = getdefaultlocale()
- print 'Language: ', lang or '(undefined)'
- print 'Encoding: ', enc or '(undefined)'
- print
+ print('Language: ', lang or '(undefined)')
+ print('Encoding: ', enc or '(undefined)')
+ print()
- print 'Locale settings on startup:'
- print '-'*72
+ print('Locale settings on startup:')
+ print('-'*72)
for name,category in categories.items():
- print name, '...'
+ print(name, '...')
lang, enc = getlocale(category)
- print ' Language: ', lang or '(undefined)'
- print ' Encoding: ', enc or '(undefined)'
- print
+ print(' Language: ', lang or '(undefined)')
+ print(' Encoding: ', enc or '(undefined)')
+ print()
- print
- print 'Locale settings after calling resetlocale():'
- print '-'*72
+ print()
+ print('Locale settings after calling resetlocale():')
+ print('-'*72)
resetlocale()
for name,category in categories.items():
- print name, '...'
+ print(name, '...')
lang, enc = getlocale(category)
- print ' Language: ', lang or '(undefined)'
- print ' Encoding: ', enc or '(undefined)'
- print
+ print(' Language: ', lang or '(undefined)')
+ print(' Encoding: ', enc or '(undefined)')
+ print()
try:
setlocale(LC_ALL, "")
except:
- print 'NOTE:'
- print 'setlocale(LC_ALL, "") does not support the default locale'
- print 'given in the OS environment variables.'
+ print('NOTE:')
+ print('setlocale(LC_ALL, "") does not support the default locale')
+ print('given in the OS environment variables.')
else:
- print
- print 'Locale settings after calling setlocale(LC_ALL, ""):'
- print '-'*72
+ print()
+ print('Locale settings after calling setlocale(LC_ALL, ""):')
+ print('-'*72)
for name,category in categories.items():
- print name, '...'
+ print(name, '...')
lang, enc = getlocale(category)
- print ' Language: ', lang or '(undefined)'
- print ' Encoding: ', enc or '(undefined)'
- print
+ print(' Language: ', lang or '(undefined)')
+ print(' Encoding: ', enc or '(undefined)')
+ print()
###
@@ -1553,10 +1553,10 @@ else:
__all__.append("LC_MESSAGES")
if __name__=='__main__':
- print 'Locale aliasing:'
- print
+ print('Locale aliasing:')
+ print()
_print_locale()
- print
- print 'Number formatting:'
- print
+ print()
+ print('Number formatting:')
+ print()
_test()