Salome HOME
Copyright update 2022
[tools/medcoupling.git] / src / MEDLoader / Swig / VTKReader.py
index 48368bd7c62c77713547555b23c8d0840ccc4df1..20d21ddeb18e5f96659ad645252e3fa67e527d3f 100644 (file)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2016  CEA/DEN, EDF R&D
+# Copyright (C) 2007-2022  CEA/DEN, EDF R&D
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -105,7 +105,7 @@ class PVTUReader:
                     self._tmp=3
                     return
                 if name=="PDataArray":
-                    if self._tmp in self._data_array.keys():
+                    if self._tmp in self._data_array:
                         self._data_array[self._tmp](attrs)
                         pass
                     return
@@ -270,7 +270,7 @@ class VTURawReader:
         except self.NormalException as e:
             isOK=True
             fd.seek(0)
-            for i in xrange(e.getLineNb()): fd.readline()
+            for i in range(e.getLineNb()): fd.readline()
             ref=fd.tell()+5
             pass
         if not isOK:
@@ -285,11 +285,11 @@ class VTURawReader:
 
     def __init__(self,fileName,tim=(0.,0)):
         msg="The time specified in constructor as 2nd arg should be a tuple containing 2 values 1 float and 1 int !"
-        if type(tim)!=tuple:
+        if not isinstance(tim, tuple):
             raise Exception(msg)
         if len(tim)!=2:
             raise Exception(msg)
-        if type(tim[0])!=float or type(tim[1])!=int:
+        if not isinstance(tim[0], float) or not isinstance(tim[1], int):
             raise Exception(msg)
         self._fileName=fileName
         self._time=tim