GraphBase
class has function get_eid(v1, v2, directed=True, error=True)
that returns arbitrary edge between vertices specified by their indices. In you call it like this:
g.get_eid(v1, v2, directed=False, error=False)
it will return -1 if the vertices are disconnected, and some edge otherwise.