Commit 8d7af911 authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Raise ValueError if non-bool properties are passed to Graph.set_vertex/edge_filter()

parent ab15e6b2
......@@ -1978,6 +1978,9 @@ class Graph(object):
``False`` are kept. If the supplied property is ``None``, the filter is
replaced by an uniform filter allowing all vertices."""
if prop is not None and prop.value_type() != "bool":
raise ValueError("filter property map must have 'bool' type")
vfilt = prop
efilt = None
......@@ -2008,6 +2011,9 @@ class Graph(object):
are kept. If the supplied property is ``None``, the filter is
replaced by an uniform filter allowing all edges."""
if prop is not None and prop.value_type() != "bool":
raise ValueError("filter property map must have 'bool' type")
efilt = prop
vfilt = None
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment