Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions ptf
Original file line number Diff line number Diff line change
Expand Up @@ -186,21 +186,21 @@ be subtracted from the result by prefixing them with the '^' character. """
try:
ports = ports.strip("{}")
ports = ports.split(",")
except:
except AttributeError:
raise ValueError("")
for port in ports:
try:
p = int(port)
port_set.add(p)
continue
except:
except ValueError:
pass
try:
p1, p2 = port.split("-", 1)
p1, p2 = int(p1), int(p2)
for p in range(p1, p2 + 1): # p2 included
port_set.add(p)
except:
except ValueError:
raise ValueError("")
return port_set

Expand Down Expand Up @@ -575,7 +575,7 @@ def load_test_modules(config):
mod = sys.modules[modname]
else:
mod = import_module(root, modname)
except:
except Exception:
logging.warning("Could not import file " + filename)
raise

Expand Down Expand Up @@ -701,7 +701,7 @@ def test_params_parse(config):
namespace = {}
try:
exec(params_str, namespace)
except:
except ImportError:
logging.error(
"Error when parsing test params "
"(provided with '--test-params' / '-t'). "
Expand Down Expand Up @@ -783,7 +783,7 @@ group or their module's test group.""")
try:
desc = (test.__doc__ or "").strip()
desc = desc.split("\n")[0]
except:
except Exception:
desc = "No description"
groups = set(test._groups) - set(["all", "standard", modname])
all_groups.update(test._groups)
Expand Down Expand Up @@ -855,19 +855,19 @@ logging.info("Importing platform: " + platform_name)
if platform_name == "nn":
try:
import pynng
except:
except Exception:
die("Cannot use 'nn' platform if pynng package is not installed")

platform_mod = None
try:
platform_mod = import_module(config["platform_dir"], platform_name)
except:
except Exception:
logging.warn("Failed to import " + platform_name + " platform module")
raise

try:
platform_mod.platform_config_update(config)
except:
except Exception:
logging.warn("Could not run platform host configuration")
raise

Expand Down
Loading