提交 50a7ca7d 编写于 作者: A Alessio Sergi

Remove unused imports and fix a bare except statement

上级 3daf08c8
......@@ -21,12 +21,11 @@
import os
from glances.compat import range, u
from glances.compat import range
from glances.logger import logger
# Use the built-in version of scandir/walk if possible, otherwise
# use the scandir module version
scandir_tag = True
try:
# For Python 3.5 or higher
......@@ -35,7 +34,7 @@ except ImportError:
# For others...
try:
from scandir import scandir
except Exception as e:
except ImportError:
scandir_tag = False
......
......@@ -19,10 +19,8 @@
"""Folder plugin."""
from glances.compat import u
from glances.folder_list import FolderList as glancesFolderList
from glances.plugins.glances_plugin import GlancesPlugin
from glances.logger import logger
class Plugin(GlancesPlugin):
......@@ -116,7 +114,7 @@ class Plugin(GlancesPlugin):
ret.append(self.curse_add_line(msg))
try:
msg = '{0:>6}'.format(self.auto_unit(i['size']))
except:
except TypeError:
msg = '{0:>6}'.format('?')
ret.append(self.curse_add_line(msg, self.get_alert(i)))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册