Remove unused imports and fix a bare except statement

pull/755/head
Alessio Sergi 2015-12-11 11:55:15 +01:00
parent 3daf08c80f
commit 50a7ca7dee
2 changed files with 3 additions and 6 deletions

View File

@ -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

View File

@ -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)))