[Freeipa-devel] [PATCH] Use Exception class instead of BaseException

Niranjan mrniranjan at fedoraproject.org
Thu Jun 4 04:28:00 UTC 2015


Petr Viktorin wrote:
> On 06/01/2015 06:33 AM, Niranjan wrote:
> > Greetings,
> > 
> > I would like to present patch for replacing StandardError exception
> > with Exception class in ipapython/adminutil.py. Also replacing
> > BaseException class with Exception class. 
> > 
> > Though the use of StandardError is many places. I would like to start
> > with ipapython/adminutil.py
> > 
> > This is my first patch. Please let me know if my approach on this is 
> > correct.
> > 
> > Regards
> > Niranjan
> > 
> > 
> > 0001-Use-Exception-class-instead-of-BaseException.patch
> > 
> > 
> > From 018312f76952ea86c8c6e2396657e0531d2d61ba Mon Sep 17 00:00:00 2001
> > From: Niranjan Mallapadi <mrniranjan at redhat.com>
> > Date: Mon, 1 Jun 2015 09:41:05 +0530
> > Subject: [PATCH] Use Exception class instead of BaseException
> > 
> > 1. Replace BaseException with Exception class.
> 
> I don't see a reason for this change. This is top-level CLI code that
> handles calling our Python library. We really do want to catch all
> exceptions here, including KeyboardInterrupt and SystemExit.
> 
> > 2. Remove StandardError and use Exception class. StandError is deprecated (Python3)
> 
> I'm okay with this change, as long as tests still pass.
> 
> > 3 .From python3.0 use of , is not recommended, instead
> > use "as" keyword (PEP 3110)
> 
> +1
I will send a modified patch and also run tests before sending them,
Thanks a lot for the review.

> 
> 
> -- 
> Petr Viktorin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 311 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20150604/389ae2df/attachment.sig>


More information about the Freeipa-devel mailing list