Statement: with and tarfile
<p>I try to use <code>with</code> statement and tarfile module...</p>

<pre><code>with tarfile.open('/dir/dir/dir.tar.gz', 'w:gz') as fl:
    fl.add('/dir/dir/dir/', arcname = '/')
</code></pre>

<p>So it shows the next:</p>

<pre>
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'TarFile' object has no attribute '__exit__'
</pre>

<p>I try to create tar.gz file and close it using statement is, but it show an error. What is the problem?</p>

<p>Thanks!</p>
