Re: Why Error is derived from EnvironmentError in shutil.py?

2009-11-12 Thread Chris Rebert
On Thu, Nov 12, 2009 at 7:10 AM, Peng Yu wrote: > On Thu, Nov 12, 2009 at 12:00 AM, alex23 wrote: >> On Nov 12, 2:46 pm, Peng Yu wrote: >>> I see Error is derived from EnvironmentError in shutil.py. >>> >>> class Error(EnvironmentError): >>>     pass >>> >>> I'm wondering why EnvironmentError ca

Re: Why Error is derived from EnvironmentError in shutil.py?

2009-11-12 Thread Peng Yu
On Thu, Nov 12, 2009 at 12:00 AM, alex23 wrote: > On Nov 12, 2:46 pm, Peng Yu wrote: >> I see Error is derived from EnvironmentError in shutil.py. >> >> class Error(EnvironmentError): >>     pass >> >> I'm wondering why EnvironmentError can not be raised directly. Why >> Error is raised instead?

Re: Why Error is derived from EnvironmentError in shutil.py?

2009-11-11 Thread alex23
On Nov 12, 2:46 pm, Peng Yu wrote: > I see Error is derived from EnvironmentError in shutil.py. > > class Error(EnvironmentError): >     pass > > I'm wondering why EnvironmentError can not be raised directly. Why > Error is raised instead? This way you can explicitly trap on shutil.Error and not

Re: Why Error is derived from EnvironmentError in shutil.py?

2009-11-11 Thread Steven D'Aprano
On Wed, 11 Nov 2009 22:46:34 -0600, Peng Yu wrote: > I see Error is derived from EnvironmentError in shutil.py. > > class Error(EnvironmentError): > pass > > I'm wondering why EnvironmentError can not be raised directly. Why Error > is raised instead? Probably to do with the personal taste

Why Error is derived from EnvironmentError in shutil.py?

2009-11-11 Thread Peng Yu
I see Error is derived from EnvironmentError in shutil.py. class Error(EnvironmentError): pass I'm wondering why EnvironmentError can not be raised directly. Why Error is raised instead? -- http://mail.python.org/mailman/listinfo/python-list