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

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

Issue 776883002: pylint: upgrade to 1.4.0 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
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
===================================================================
--- third_party/logilab/common/dbf.py (revision 293207)
+++ third_party/logilab/common/dbf.py (working copy)
@@ -30,6 +30,7 @@
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 @@
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 @@
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 @@
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