dag: avoid sys.maxint

sys.maxint was removed in Python3.
Use a locally-defined variable instead.

Closes #249

Reported-by: Liviu Cristian Mirea-Ghiban <contact@liviucmg.com>
Signed-off-by: David Aguilar <davvid@gmail.com>