Skip to content

Commit 6107bbf

Browse files
committed
Python 3 preparation: numeric literal syntax.
Fixes octal constants to use leading 0o, and removes 'L' suffixes. Tool-assisted patch.
1 parent 479c0d0 commit 6107bbf

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

roundup/backends/indexer_dbm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def force_reindex(self):
6262
if os.path.exists(self.indexdb_path):
6363
shutil.rmtree(self.indexdb_path)
6464
os.makedirs(self.indexdb_path)
65-
os.chmod(self.indexdb_path, 0775)
65+
os.chmod(self.indexdb_path, 0o775)
6666
open(os.path.join(self.indexdb_path, 'version'), 'w').write('1\n')
6767
self.reindex = 1
6868
self.changed = 1
@@ -251,7 +251,7 @@ def save_index(self):
251251
filename = self.indexdb + initchar
252252
pickle_fh = open(filename, 'wb')
253253
pickle_fh.write(zlib.compress(pickle_str))
254-
os.chmod(filename, 0664)
254+
os.chmod(filename, 0o664)
255255

256256
# save done
257257
self.changed = 0

roundup/date.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,7 @@ def as_seconds(self):
10121012
Months are counted as 30 days, years as 365 days. Returns a Long
10131013
int.
10141014
'''
1015-
n = self.year * 365L
1015+
n = self.year * 365
10161016
n = n + self.month * 30
10171017
n = n + self.day
10181018
n = n * 24

roundup/dist/command/build_scripts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,4 +140,4 @@ def copy_scripts(self):
140140
% script_vars)
141141
finally:
142142
file.close()
143-
os.chmod(outfile, 0755)
143+
os.chmod(outfile, 0o755)

roundup/msgfmt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def generate():
8585
voffsets += [l2, o2+valuestart]
8686
offsets = koffsets + voffsets
8787
output = struct.pack("Iiiiiii",
88-
0x950412deL, # Magic
88+
0x950412de, # Magic
8989
0, # Version
9090
len(keys), # # of entries
9191
7*4, # start of key index

test/test_dates.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ def testTimestamp(self):
454454
ae(date.timestamp(), 2147483647)
455455
ae(str(date), '2038-01-19.03:14:07')
456456
date = Date('1901-12-13.20:45:52')
457-
ae(date.timestamp(), -0x80000000L)
457+
ae(date.timestamp(), -0x80000000)
458458
ae(str(date), '1901-12-13.20:45:52')
459459
date = Date('9999')
460460
ae (date.timestamp(), 253370764800.0)

0 commit comments

Comments
 (0)