Patchwork [2,of,2] demandimport: blacklist sqlalchemy.events as it has side effects (issue5085)

login
register
mail settings
Submitter Yuya Nishihara
Date Feb. 21, 2016, 5:37 a.m.
Message ID <8f0f47ac818fb74ab122.1456033072@mimosa>
Download mbox | patch
Permalink /patch/13283/
State Accepted
Headers show

Comments

Yuya Nishihara - Feb. 21, 2016, 5:37 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1454753772 -32400
#      Sat Feb 06 19:16:12 2016 +0900
# Node ID 8f0f47ac818fb74ab1220542661b751d1370d0c1
# Parent  b7583bf4ed46e7c022467c43c68eea0fc25e4069
demandimport: blacklist sqlalchemy.events as it has side effects (issue5085)

Importing sqlalchemy.events cannot be delayed as it registers classes to
their event mechanism. It worked fine before 4f1144c3c72b, since they use
new-style imports. But now we have to blacklist it because our demandimport
can handle new-style imports.

This patch series isn't intended for stable as we don't guarantee API
compatibility with 3rd-party extensions. They can temporarily disable the
demand importer to work around the issue.
Pierre-Yves David - Feb. 21, 2016, 10:02 a.m.
On 02/21/2016 06:37 AM, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1454753772 -32400
> #      Sat Feb 06 19:16:12 2016 +0900
> # Node ID 8f0f47ac818fb74ab1220542661b751d1370d0c1
> # Parent  b7583bf4ed46e7c022467c43c68eea0fc25e4069
> demandimport: blacklist sqlalchemy.events as it has side effects (issue5085)

Pushed to the clowncopter. Thanks for tackling this.

Patch

diff --git a/mercurial/demandimport.py b/mercurial/demandimport.py
--- a/mercurial/demandimport.py
+++ b/mercurial/demandimport.py
@@ -255,6 +255,7 @@  ignore = [
     '_sre', # issue4920
     'rfc822',
     'mimetools',
+    'sqlalchemy.events', # has import-time side effects (issue5085)
     # setuptools 8 expects this module to explode early when not on windows
     'distutils.msvc9compiler'
     ]