Use OSError instead of FileNotFoundError to work on both py2 and py3
This commit is contained in:
parent
1a9be22205
commit
f31f81c1b4
6
setup.py
6
setup.py
@ -46,7 +46,7 @@ class PublishCommand(Command):
|
|||||||
|
|
||||||
description = 'Build and publish the package.'
|
description = 'Build and publish the package.'
|
||||||
user_options = []
|
user_options = []
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def status(s):
|
def status(s):
|
||||||
"""Prints things in bold."""
|
"""Prints things in bold."""
|
||||||
@ -62,7 +62,7 @@ class PublishCommand(Command):
|
|||||||
try:
|
try:
|
||||||
self.status('Removing previous builds…')
|
self.status('Removing previous builds…')
|
||||||
rmtree(os.path.join(here, 'dist'))
|
rmtree(os.path.join(here, 'dist'))
|
||||||
except FileNotFoundError:
|
except OSError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
self.status('Building Source and Wheel (universal) distribution…')
|
self.status('Building Source and Wheel (universal) distribution…')
|
||||||
@ -108,7 +108,7 @@ setup(
|
|||||||
'Programming Language :: Python :: Implementation :: CPython',
|
'Programming Language :: Python :: Implementation :: CPython',
|
||||||
'Programming Language :: Python :: Implementation :: PyPy'
|
'Programming Language :: Python :: Implementation :: PyPy'
|
||||||
],
|
],
|
||||||
# $ setup.py publish support.
|
# $ setup.py publish support.
|
||||||
cmdclass={
|
cmdclass={
|
||||||
'publish': PublishCommand,
|
'publish': PublishCommand,
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user