Message145721
To clarify: Python 2.5 and higher support the with statement syntax, but not all classes that could benefit from it have the __enter__ and __exit__ methods. So you don’t get a SyntaxError in Python 2.7 when you write “with Popen(...)”, but you get an AttributeError because Popen in 2.7 does not do its part to support context management. The built-in open function, on the contrary, supports with in 2.5 and higher. |
|
Date |
User |
Action |
Args |
2011-10-17 16:03:31 | eric.araujo | set | recipients:
+ eric.araujo, LambertDW |
2011-10-17 16:03:31 | eric.araujo | set | messageid: <1318867411.47.0.797862773.issue13202@psf.upfronthosting.co.za> |
2011-10-17 16:03:30 | eric.araujo | link | issue13202 messages |
2011-10-17 16:03:30 | eric.araujo | create | |
|