Commit f3829d8b authored by Jason R. Coombs's avatar Jason R. Coombs

Use numbers.Number to detect numeric type

parent b8865685
...@@ -23,7 +23,6 @@ if PY2: ...@@ -23,7 +23,6 @@ if PY2:
long_type = long long_type = long
maxsize = sys.maxint maxsize = sys.maxint
next = lambda o: o.next() next = lambda o: o.next()
numeric_types = (int, long, float)
unichr = unichr unichr = unichr
unicode = unicode unicode = unicode
bytes = str bytes = str
...@@ -52,7 +51,6 @@ if PY3: ...@@ -52,7 +51,6 @@ if PY3:
long_type = int long_type = int
maxsize = sys.maxsize maxsize = sys.maxsize
next = next next = next
numeric_types = (int, float)
unichr = chr unichr = chr
unicode = str unicode = str
bytes = bytes bytes = bytes
......
...@@ -4,6 +4,7 @@ import re ...@@ -4,6 +4,7 @@ import re
import os import os
import sys import sys
import warnings import warnings
import numbers
import distutils.log import distutils.log
import distutils.core import distutils.core
import distutils.cmd import distutils.cmd
...@@ -13,7 +14,7 @@ from distutils.errors import (DistutilsOptionError, DistutilsPlatformError, ...@@ -13,7 +14,7 @@ from distutils.errors import (DistutilsOptionError, DistutilsPlatformError,
DistutilsSetupError) DistutilsSetupError)
from setuptools.depends import Require from setuptools.depends import Require
from setuptools.compat import numeric_types, basestring, PY2 from setuptools.compat import basestring, PY2
import pkg_resources import pkg_resources
def _get_unpatched(cls): def _get_unpatched(cls):
...@@ -263,7 +264,7 @@ class Distribution(_Distribution): ...@@ -263,7 +264,7 @@ class Distribution(_Distribution):
if not hasattr(self,ep.name): if not hasattr(self,ep.name):
setattr(self,ep.name,None) setattr(self,ep.name,None)
_Distribution.__init__(self,attrs) _Distribution.__init__(self,attrs)
if isinstance(self.metadata.version, numeric_types): if isinstance(self.metadata.version, numbers.Number):
# Some people apparently take "version number" too literally :) # Some people apparently take "version number" too literally :)
self.metadata.version = str(self.metadata.version) self.metadata.version = str(self.metadata.version)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment