Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(358)

Unified Diff: third_party/logilab/common/dbf.py

Issue 753543006: pylint: upgrade to 1.4.0 (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/logilab/common/date.py ('k') | third_party/logilab/common/deprecation.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/logilab/common/dbf.py
diff --git a/third_party/logilab/common/dbf.py b/third_party/logilab/common/dbf.py
index bb1b9e666968b20b2fac71279a569e49c0b4de52..ab142b23cfcde7fea56877a3a85b5b8a5052a091 100644
--- a/third_party/logilab/common/dbf.py
+++ b/third_party/logilab/common/dbf.py
@@ -30,6 +30,7 @@ Usage:
http://www.physics.ox.ac.uk/users/santoso/Software.Repository.html
page says code is "available as is without any warranty or support".
"""
+from __future__ import print_function
import struct
import os, os.path
@@ -79,7 +80,7 @@ class Dbase:
def open(self, db_name):
filesize = os.path.getsize(db_name)
if filesize <= 68:
- raise IOError, 'The file is not large enough to be a dbf file'
+ raise IOError('The file is not large enough to be a dbf file')
self.fdb = open(db_name, 'rb')
@@ -152,7 +153,7 @@ class Dbase:
This function accept record number from 0 to N-1
"""
if rec_no < 0 or rec_no > self.num_records:
- raise Exception, 'Unable to extract data outside the range'
+ raise Exception('Unable to extract data outside the range')
offset = self.header['Record Size'] * rec_no
data = self.db_data[offset:offset+self.row_len]
@@ -227,4 +228,4 @@ def readDbf(filename):
if __name__=='__main__':
rec = readDbf('dbf/sptable.dbf')
for line in rec:
- print '%s %s' % (line['GENUS'].strip(), line['SPECIES'].strip())
+ print('%s %s' % (line['GENUS'].strip(), line['SPECIES'].strip()))
« no previous file with comments | « third_party/logilab/common/date.py ('k') | third_party/logilab/common/deprecation.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698