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

Petr Viktorin pviktori at redhat.com
Wed Jun 3 12:40:03 UTC 2015


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


-- 
Petr Viktorin




More information about the Freeipa-devel mailing list