mwt wrote:
> (Whoops, again.)
>
> def __init__(self, config_file):
> self.fahdata = fahdata.FAHData()
> self.INI = ConfigParser.ConfigParser()
> if os.path.exists(config_file):
> try:
> self.INI.read(config_file)
> except ConfigParser
(Whoops, again.)
def __init__(self, config_file):
self.fahdata = fahdata.FAHData()
self.INI = ConfigParser.ConfigParser()
if os.path.exists(config_file):
try:
self.INI.read(config_file)
except ConfigParser.Error, err:
Would something like this be more useful?
def __init__(self, config_file):
self.fahdata = fahdata.FAHData()
self.INI = ConfigParser.ConfigParser()
if os.path.exists(config_file):
try:
self.INI.read(config_file)
except ConfigParser.Err
mwt wrote:
> Hi -
> I'm having a little trouble using exceptions properly. I currently have
> an initialization function on a little app that looks like this:
>
> def __init__(self, config_file):
> self.fahdata = fahdata.FAHData()
> self.INI = ConfigParser.ConfigParser()
>
Whoops. Those page numbers are from "Cookbook."
As well as the Except section in "Nutshell."
Still stewing away here. ;)
--
http://mail.python.org/mailman/listinfo/python-list