Browse Source

fix error parsing PandaVersion.pp with Python 3

rdb 12 years ago
parent
commit
3241443077
1 changed files with 3 additions and 3 deletions
  1. 3 3
      makepanda/makepandacore.py

+ 3 - 3
makepanda/makepandacore.py

@@ -2352,7 +2352,7 @@ def CopyTree(dstdir, srcdir, omitCVS=True):
 
 def ParsePandaVersion(fn):
     try:
-        f = file(fn, "r")
+        f = open(fn, "r")
         pattern = re.compile('^[ \t]*[#][ \t]*define[ \t]+PANDA_VERSION[ \t]+([0-9]+)[ \t]+([0-9]+)[ \t]+([0-9]+)')
         for line in f:
             match = pattern.match(line,0)
@@ -2365,7 +2365,7 @@ def ParsePandaVersion(fn):
 
 def ParsePluginVersion(fn):
     try:
-        f = file(fn, "r")
+        f = open(fn, "r")
         pattern = re.compile('^[ \t]*[#][ \t]*define[ \t]+P3D_PLUGIN_VERSION[ \t]+([0-9]+)[ \t]+([0-9]+)[ \t]+([0-9]+)')
         for line in f:
             match = pattern.match(line,0)
@@ -2378,7 +2378,7 @@ def ParsePluginVersion(fn):
 
 def ParseCoreapiVersion(fn):
     try:
-        f = file(fn, "r")
+        f = open(fn, "r")
         pattern = re.compile('^[ \t]*[#][ \t]*define[ \t]+P3D_COREAPI_VERSION.*([0-9]+)[ \t]*$')
         for line in f:
             match = pattern.match(line,0)