Merge pull request #1646 from jradtilbrook/fix/1645-flake8-e722

fix/1645-flake8-e722
This commit is contained in:
Nick Steel 2017-11-04 12:59:36 +00:00 committed by GitHub
commit 9e31e76a05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 7 deletions

View File

@ -5,6 +5,10 @@ import os
import signal
import sys
import pykka.debug
from mopidy import commands, config as config_lib, ext
from mopidy.internal import encoding, log, path, process, versioning
from mopidy.internal.gi import Gst # noqa: F401
try:
@ -15,11 +19,6 @@ try:
except ImportError:
pass
import pykka.debug
from mopidy import commands, config as config_lib, ext
from mopidy.internal import encoding, log, path, process, versioning
logger = logging.getLogger(__name__)

View File

@ -34,7 +34,7 @@ def replace(path, mode='w+b', encoding=None, errors=None):
(fd, tempname) = tempfile.mkstemp(dir=os.path.dirname(path))
try:
fp = io.open(fd, mode, encoding=encoding, errors=errors)
except:
except Exception:
os.remove(tempname)
os.close(fd)
raise
@ -43,7 +43,7 @@ def replace(path, mode='w+b', encoding=None, errors=None):
fp.flush()
os.fsync(fd)
os.rename(tempname, path)
except:
except Exception:
os.remove(tempname)
raise
finally: