more python3 adjustments

This commit is contained in:
ndparker 2015-03-08 23:30:54 +01:00
parent fe73619660
commit 575aecc254
2 changed files with 21 additions and 9 deletions

View File

@ -62,9 +62,17 @@
#define EXT3
#ifndef Py_TPFLAGS_HAVE_CLASS
#define Py_TPFLAGS_HAVE_CLASS (0)
#endif
#ifndef Py_TPFLAGS_HAVE_WEAKREFS
#define Py_TPFLAGS_HAVE_WEAKREFS (0)
#endif
#ifndef Py_TPFLAGS_HAVE_ITER
#define Py_TPFLAGS_HAVE_ITER (0)
#endif
#ifndef PyMODINIT_FUNC
#define EXT_INIT_FUNC PyObject *CONCATENATE(PyInit_, EXT_MODULE)(void)

View File

@ -250,14 +250,14 @@ def make_manifest(manifest, config, docs, kwargs):
kwargs['packages'] = list(kwargs.get('packages') or ()) + [
'_setup', '_setup.py2', '_setup.py3',
] + list(manifest.get('packages.extra', '').split() or ())
_core._setup_stop_after = "commandline"
_core._setup_stop_after = "commandline" # noqa pylint: disable = protected-access
try:
dist = _core.setup(**kwargs)
finally:
_core._setup_stop_after = None
_core._setup_stop_after = None # pylint: disable = protected-access
result = ['MANIFEST', 'PKG-INFO', 'setup.py'] + list(config)
# TODO: work with default values:
# xx: work with default values?
for key in ('classifiers', 'description', 'summary', 'provides',
'license'):
filename = docs.get('meta.' + key, '').strip()
@ -335,10 +335,14 @@ def make_manifest(manifest, config, docs, kwargs):
def run(config=('package.cfg',), ext=None, script_args=None, manifest_only=0):
""" Main runner """
# pylint: disable = too-many-locals
if ext is None:
ext = []
cfg = _util.SafeConfigParser()
if (3, 0, 0) <= _sys.version_info < (3, 2, 0):
cfg.read(config)
else:
cfg.read(config, encoding='utf-8')
pkg = dict(cfg.items('package'))
python_min = pkg.get('python.min') or None