From 434034ab8915fdbbf82445945101d1564712eb5a Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Mon, 14 Jan 2013 16:16:20 +0200 Subject: [PATCH] BmapCopy: do not check for os.path.exists exceptions It is very unlikely that it fails, but if it does, we'll just have an unhandled exception, which is fine in this case. Change-Id: If89940b0e38ed9874380788c088f44e733d6435f Signed-off-by: Artem Bityutskiy --- bmaptools/BmapCopy.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/bmaptools/BmapCopy.py b/bmaptools/BmapCopy.py index 92532dc..e98a594 100644 --- a/bmaptools/BmapCopy.py +++ b/bmaptools/BmapCopy.py @@ -621,12 +621,8 @@ class BmapBdevCopy(BmapCopy): # Check if the 'queue' sub-directory exists. If yes, then our block # device is entire disk. Otherwise, it is a partition, in which case we # need to go one level up in the sysfs hierarchy. - try: - if not os.path.exists(self._sysfs_base + "queue"): - self._sysfs_base = self._sysfs_base + "../" - except OSError: - # No problem, this is just an optimization. - pass + if not os.path.exists(self._sysfs_base + "queue"): + self._sysfs_base = self._sysfs_base + "../" self._sysfs_scheduler_path = self._sysfs_base + "queue/scheduler" self._sysfs_max_ratio_path = self._sysfs_base + "bdi/max_ratio" -- 2.7.4