From 13292ee936e1b55581e3473b9a928b9f426e53a8 Mon Sep 17 00:00:00 2001 From: Wenjun Deng Date: Sun, 15 Dec 2013 14:56:35 -0500 Subject: [PATCH] bin/pythonscripts: updated petsc_conf.py and PetscBinaryIO.py to be compatible with Python 3 --- bin/pythonscripts/PetscBinaryIO.py | 1 - bin/pythonscripts/petsc_conf.py | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/bin/pythonscripts/PetscBinaryIO.py b/bin/pythonscripts/PetscBinaryIO.py index 8016d06..2441131 100755 --- a/bin/pythonscripts/PetscBinaryIO.py +++ b/bin/pythonscripts/PetscBinaryIO.py @@ -198,7 +198,6 @@ class PetscBinaryIO(object): if self.precision == 'longlong': nbyte = 16 - print nbyte elif self.precision == 'single': nbyte = 4 else: diff --git a/bin/pythonscripts/petsc_conf.py b/bin/pythonscripts/petsc_conf.py index c9f63c6..02cdb64 100755 --- a/bin/pythonscripts/petsc_conf.py +++ b/bin/pythonscripts/petsc_conf.py @@ -31,7 +31,7 @@ def get_conf(): petscconfinclude = os.path.join(petscdir, 'include', 'petscconf.h') try: - fid = file(petscvariables, 'r') + fid = open(petscvariables, 'r') except IOError: warnings.warn('Nonexistent or invalid PETSc installation, using defaults') return None, None, None @@ -43,7 +43,7 @@ def get_conf(): fid.close() try: - fid = file(petscconfinclude, 'r') + fid = open(petscconfinclude, 'r') except IOError: warnings.warn('Nonexistent or invalid PETSc installation, using defaults') return None, None, None -- 1.8.3.4 (Apple Git-47)