Thread: Raise an exception under Python < 3.4

Raise an exception under Python < 3.4

From
Dave Page
Date:
The attached patch raises an exception if run under Python < 3.4. It also cleans up the README to remove references to Python 2 and removes Python 2-isms from the main config.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Attachment

Re: Raise an exception under Python < 3.4

From
Neel Patel
Date:
Hi Dave,

Patch looks good to me except one condition as we do support from Python 3.4 onwards. I have modified that condition and attached the updated patch.

I have also removed the other references of Python2. Attached is the patch. Do review it and let me know for comments.

Thanks,
Neel Patel

On Mon, Apr 27, 2020 at 9:27 PM Dave Page <dpage@pgadmin.org> wrote:
The attached patch raises an exception if run under Python < 3.4. It also cleans up the README to remove references to Python 2 and removes Python 2-isms from the main config.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Attachment

Re: Raise an exception under Python < 3.4

From
Dave Page
Date:
Hi

On Wed, Apr 29, 2020 at 10:13 AM Neel Patel <neel.patel@enterprisedb.com> wrote:
Hi Dave,

Patch looks good to me except one condition as we do support from Python 3.4 onwards. I have modified that condition and attached the updated patch.

What did you change exactly (curious about what I missed)?
 

I have also removed the other references of Python2. Attached is the patch. Do review it and let me know for comments.

I think there's a lot more than that - try searching the entire tree for PY2 or sys.version. This was on my personal todo as a next step, but feel free to update your patch :-)

Thanks!
 

Thanks,
Neel Patel

On Mon, Apr 27, 2020 at 9:27 PM Dave Page <dpage@pgadmin.org> wrote:
The attached patch raises an exception if run under Python < 3.4. It also cleans up the README to remove references to Python 2 and removes Python 2-isms from the main config.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Re: Raise an exception under Python < 3.4

From
Neel Patel
Date:
Hi,

On Wed, Apr 29, 2020 at 2:52 PM Dave Page <dpage@pgadmin.org> wrote:
Hi

On Wed, Apr 29, 2020 at 10:13 AM Neel Patel <neel.patel@enterprisedb.com> wrote:
Hi Dave,

Patch looks good to me except one condition as we do support from Python 3.4 onwards. I have modified that condition and attached the updated patch.

What did you change exactly (curious about what I missed)?

Previously it was like,

+if sys.version_info < (3, 3):
+    raise Exception('This application must be run under Python 3.4 or later.')
 
Modified as below.

+if sys.version_info < (3, 4):

+    raise Exception('This application must be run under Python 3.4 or later.')



 

I have also removed the other references of Python2. Attached is the patch. Do review it and let me know for comments.

I think there's a lot more than that - try searching the entire tree for PY2 or sys.version. This was on my personal todo as a next step, but feel free to update your patch :-)

Sure.
 

Thanks!
 

Thanks,
Neel Patel

On Mon, Apr 27, 2020 at 9:27 PM Dave Page <dpage@pgadmin.org> wrote:
The attached patch raises an exception if run under Python < 3.4. It also cleans up the README to remove references to Python 2 and removes Python 2-isms from the main config.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Re: Raise an exception under Python < 3.4

From
Akshay Joshi
Date:
Hi Dave

Can we add a similar exception in our test suites? Instead of throwing import error, it would be good. If you agree I'll modify the logic.  

On Mon, Apr 27, 2020 at 9:27 PM Dave Page <dpage@pgadmin.org> wrote:
The attached patch raises an exception if run under Python < 3.4. It also cleans up the README to remove references to Python 2 and removes Python 2-isms from the main config.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


--
Thanks & Regards
Akshay Joshi
Sr. Software Architect
EnterpriseDB Software India Private Limited
Mobile: +91 976-788-8246

Re: Raise an exception under Python < 3.4

From
Dave Page
Date:
Hi Akshay,

Sure, go for it.

On Thu, Apr 30, 2020 at 9:14 AM Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
Hi Dave

Can we add a similar exception in our test suites? Instead of throwing import error, it would be good. If you agree I'll modify the logic.  

On Mon, Apr 27, 2020 at 9:27 PM Dave Page <dpage@pgadmin.org> wrote:
The attached patch raises an exception if run under Python < 3.4. It also cleans up the README to remove references to Python 2 and removes Python 2-isms from the main config.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


--
Thanks & Regards
Akshay Joshi
Sr. Software Architect
EnterpriseDB Software India Private Limited
Mobile: +91 976-788-8246


--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Re: Raise an exception under Python < 3.4

From
Akshay Joshi
Date:
Thanks, patch applied.

Also, search PY2 and removed all the references by correcting the logic.

On Thu, Apr 30, 2020 at 1:45 PM Dave Page <dpage@pgadmin.org> wrote:
Hi Akshay,

Sure, go for it.

On Thu, Apr 30, 2020 at 9:14 AM Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
Hi Dave

Can we add a similar exception in our test suites? Instead of throwing import error, it would be good. If you agree I'll modify the logic.  

On Mon, Apr 27, 2020 at 9:27 PM Dave Page <dpage@pgadmin.org> wrote:
The attached patch raises an exception if run under Python < 3.4. It also cleans up the README to remove references to Python 2 and removes Python 2-isms from the main config.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


--
Thanks & Regards
Akshay Joshi
Sr. Software Architect
EnterpriseDB Software India Private Limited
Mobile: +91 976-788-8246


--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


--
Thanks & Regards
Akshay Joshi
Sr. Software Architect
EnterpriseDB Software India Private Limited
Mobile: +91 976-788-8246