Backport fix done by Benedikt Morbach on pylint for python3 install on win32 platforms / cross compilation. Closes #180836

authorSylvain Thénault <sylvain.thenault@logilab.fr>
changeset27140e34942b
branchdefault
phasedraft
hiddenyes
parent revision#bf74411c45cb [modutils] don't propagate IOError when package's __init__.py file doesn't exist. Closes #174606
child revision<not specified>
files modified by this revision
ChangeLog
deprecation.py
setup.py
# HG changeset patch
# User Sylvain Thénault <sylvain.thenault@logilab.fr>
# Date 1380810978 -7200
# Thu Oct 03 16:36:18 2013 +0200
# Node ID 27140e34942bbcc3d8b80bd773923b001a8d1515
# Parent bf74411c45cb4c20fc40953ba67e897438fb1839
Backport fix done by Benedikt Morbach on pylint for python3 install on win32 platforms / cross compilation. Closes #180836

diff --git a/ChangeLog b/ChangeLog
@@ -3,10 +3,13 @@
1 
2  --
3     * modutils: don't propagate IOError when package's __init__.py file doesn't
4       exist (#174606)
5 
6 +   * fix some cases of failing python3 install on windows platform / cross
7 +     compilation (#180836)
8 +
9  2013-07-26  --  0.60.0
10      * configuration: rename option_name method into option_attrname (#140667)
11 
12      * deprecation: new DeprecationManager class (closes #108205)
13 
diff --git a/deprecation.py b/deprecation.py
@@ -59,12 +59,10 @@
14 
15          class AnyClass(object):
16              __metaclass__ = deprecator.class_deprecated('1.2')
17      """
18      def __init__(self, module_name=None):
19 -        """
20 -        """
21          self.module_name = module_name
22          self.compatible_version = None
23 
24      def compatibility(self, compatible_version):
25          """Set the compatible version.
@@ -78,11 +76,11 @@
26          def decorator(func):
27              message = reason or 'The function "%s" is deprecated'
28              if '%s' in message:
29                  message %= func.func_name
30              def wrapped(*args, **kwargs):
31 -                self.warn(version, message, stacklevel)
32 +                self.warn(version, message, stacklevel+1)
33                  return func(*args, **kwargs)
34              return wrapped
35          return decorator
36 
37      def class_deprecated(self, version=None):
@@ -90,11 +88,11 @@
38              """metaclass to print a warning on instantiation of a deprecated class"""
39 
40              def __call__(cls, *args, **kwargs):
41                  msg = getattr(cls, "__deprecation_warning__",
42                                "%(cls)s is deprecated") % {'cls': cls.__name__}
43 -                self.warn(version, msg)
44 +                self.warn(version, msg, stacklevel=3)
45                  return type.__call__(cls, *args, **kwargs)
46          return metaclass
47 
48      def moved(self, version, modpath, objname):
49          """use to tell that a callable has been moved to a new module.
diff --git a/setup.py b/setup.py
@@ -137,15 +137,16 @@
50                  dest = join(basedir, directory)
51                  shutil.rmtree(dest, ignore_errors=True)
52                  shutil.copytree(directory, dest)
53                  if sys.version_info >= (3, 0):
54                      # process manually python file in include_dirs (test data)
55 -                    from subprocess import check_call
56 +                    from distutils.util import run_2to3
57                      # brackets are NOT optional here for py3k compat
58                      print('running 2to3 on', dest)
59 -                    # Needs `shell=True` to run on Windows.
60 -                    check_call(['2to3', '-wn', dest], shell=sys.platform=='win32')
61 +                    run_2to3([dest])
62 +
63 +
64 
65 
66  def install(**kwargs):
67      """setup entry point"""
68      if USE_SETUPTOOLS: