Commits

Achim Herwig committed fa6a07a

let the __enter__ method directly return the directory name.

  • Participants
  • Parent commits 387c454

Comments (0)

Files changed (2)

             self.__exit__(None, None, None)
 
     def __enter__(self):
-        return self
+        return self.name
 
     def __exit__(self, *errstuff):
         return self.dissolve()
     old_path = os.getcwd()
     try:
         with TempDir(*args, **kwargs) as t:
-            os.chdir(t.name)
+            os.chdir(t)
             yield t
     finally:
         os.chdir(old_path)
     def test_in_tempdir(self):
         old_pwd = os.getcwd()
         with tempdir.in_tempdir('asdf') as tmpdir:
-            self.assertEqual(os.getcwd(), tmpdir.name)
+            self.assertEqual(os.getcwd(), tmpdir)
         self.assertEqual(os.getcwd(), old_pwd)
 
     def test_decorator(self):