0

changed bare exceptions to except Exception

This commit is contained in:
Andrew Brown
2011-10-26 22:36:23 -04:00
parent b31160e3ad
commit f5ae4b3451
4 changed files with 8 additions and 8 deletions

View File

@@ -139,7 +139,7 @@ def main():
print "Git commit: %s" % overviewer_version.HASH
print "built on %s" % overviewer_version.BUILD_DATE
print "Build machine: %s %s" % (overviewer_version.BUILD_PLATFORM, overviewer_version.BUILD_OS)
except:
except Exception:
print "version info not found"
pass
sys.exit(0)

View File

@@ -2255,7 +2255,7 @@ def prepareBiomeData(worlddir):
try:
grasscolor = list(Image.open(os.path.join(biomeDir,"grasscolor.png")).getdata())
foliagecolor = list(Image.open(os.path.join(biomeDir,"foliagecolor.png")).getdata())
except:
except Exception:
# clear anything that managed to get set
grasscolor = None
foliagecolor = None
@@ -2316,7 +2316,7 @@ def loadLightColor():
lightcolor_checked = True
try:
lightcolor = list(_load_image("light_normal.png").getdata())
except:
except Exception:
logging.warning("Light color image could not be found.")
lightcolor = None
return lightcolor

View File

@@ -52,7 +52,7 @@ def findGitHash():
try:
import overviewer_version
return overviewer_version.HASH
except:
except Exception:
return "unknown"
def findGitVersion():
@@ -68,9 +68,9 @@ def findGitVersion():
# and 0.1.3 into 0.1.3
line = '-'.join(line.split('-', 2)[:2])
return line.strip()
except:
except Exception:
try:
import overviewer_version
return overviewer_version.VERSION
except:
except Exception:
return "unknown"

View File

@@ -142,7 +142,7 @@ except AttributeError:
try:
pil_include = os.environ['PIL_INCLUDE_DIR'].split(os.pathsep)
except:
except Exception:
pil_include = [ os.path.join(get_python_inc(plat_specific=1), 'Imaging') ]
if not os.path.exists(pil_include[0]):
pil_include = [ ]
@@ -221,7 +221,7 @@ def generate_version_py():
f = open("overviewer_core/overviewer_version.py", "w")
f.write(outstr)
f.close()
except:
except Exception:
print "WARNING: failed to build overviewer_version file"
class CustomSDist(sdist):