is it any different to use with in python 2.5, becuase at work i wasnt getting error, but now i am implementing the logic at home on python 2.5 i am getting error

from __future__ import with_statement

import nuke

grp = nuke.toNode("Group1")
with grp:
    nodes = nuke.allNodes()
    for node in nodes:
        print node.Class()

Result: <string>:2: Warning: 'with' will become a reserved keyword in Python 2.6
  File "<string>", line 2
    with grp:
SyntaxError: invalid syntax