diff options
Diffstat (limited to 'setuptools/command/bdist_egg.py')
-rw-r--r-- | setuptools/command/bdist_egg.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/setuptools/command/bdist_egg.py b/setuptools/command/bdist_egg.py index 14dd97d3..4e36c635 100644 --- a/setuptools/command/bdist_egg.py +++ b/setuptools/command/bdist_egg.py @@ -253,8 +253,10 @@ class bdist_egg(Command): m = re.match(pattern, name) path_new = os.path.join(base, os.pardir, m.group('name') + '.pyc') log.info("Renaming file from [%s] to [%s]" % (path_old, path_new)) - if os.path.exists(path_new): - os.unlink(path_new) + try: + os.remove(path_new) + except OSError: + pass os.rename(path_old, path_new) |