Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

print() is a function in Python 3 #51

Merged
merged 1 commit into from
Mar 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions gen_pot.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import print_function
import sys
import os.path
import time
Expand Down Expand Up @@ -26,12 +27,12 @@ def main():

pot = open(pot_file_name, 'wb')

print >> pot, boilerplate
print(boilerplate, file=pot)

for zone in allzones():
print >> pot, 'msgid "%s"' % zone
print >> pot, 'msgstr ""'
print >> pot
print('msgid "%s"' % zone, file=pot)
print('msgstr ""', file=pot)
print(file=pot)


if __name__ == '__main__':
Expand Down
17 changes: 9 additions & 8 deletions gen_tzinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
'''
$Id: gen_tzinfo.py,v 1.21 2005/02/15 20:21:38 zenzen Exp $
'''
from __future__ import print_function
import sys
import os
import os.path
Expand Down Expand Up @@ -123,21 +124,21 @@ def add_allzones(filename):
cz.append(zone)
cz.sort()

print >> outf, 'all_timezones = \\'
print('all_timezones = \\', file=outf)
pprint(sorted(allzones()), outf)
print >> outf, '''all_timezones = LazyList(
print('''all_timezones = LazyList(
tz for tz in all_timezones if resource_exists(tz))
'''
print >> outf, 'all_timezones_set = LazySet(all_timezones)'
''', file=outf)
print('all_timezones_set = LazySet(all_timezones)', file=outf)
# Per lp:1835784 we can't afford to do this at import time
# print >> outf, '_all_timezones_lower_to_standard = dict((tz.lower(), tz) for tz in all_timezones)'

print >> outf, 'common_timezones = \\'
print('common_timezones = \\', file=outf)
pprint(cz, outf)
print >> outf, '''common_timezones = LazyList(
print('''common_timezones = LazyList(
tz for tz in common_timezones if tz in all_timezones)
'''
print >> outf, 'common_timezones_set = LazySet(common_timezones)'
''', file=outf)
print('common_timezones_set = LazySet(common_timezones)', file=outf)

outf.close()

Expand Down