1. 28 Ock, 2018 1 kayıt (commit)
    • Martin Teichmann's avatar
      bpo-30306: release arguments of contextmanager (GH-1500) · dd0e087e
      Martin Teichmann yazdı
      The arguments to a generator function which is declared as a
      contextmanager are stored inside the context manager, and
      thus are kept alive, even when it is used as a regular context
      manager, and not as a function decorator (where it needs
      the original arguments to recreate the generator on each
      call).
      
      This is a possible unnecessary memory leak, so this changes
      contextmanager.__enter__ to release the saved arguments,
      as that method being called means that particular CM instance
      isn't going to need to recreate the underlying generator.
      
      Patch by Martin Teichmann.
      dd0e087e
  2. 25 Ock, 2018 1 kayıt (commit)
  3. 23 Kas, 2017 1 kayıt (commit)
  4. 07 Eyl, 2017 1 kayıt (commit)
  5. 09 Haz, 2017 1 kayıt (commit)
  6. 11 Nis, 2017 1 kayıt (commit)
    • svelankar's avatar
      bpo-29692: contextlib.contextmanager may incorrectly unchain RuntimeError (GH-949) · 00c75e9a
      svelankar yazdı
      contextlib._GeneratorContextManager.__exit__ includes a special case to deal with
      PEP 479 RuntimeErrors created when `StopIteration` is thrown into the context
      manager body.
      
      Previously this check was too permissive, and undid one level of chaining on *all*
      RuntimeError instances, not just those that wrapped a StopIteration instance.
      00c75e9a
  7. 20 Haz, 2016 1 kayıt (commit)
  8. 14 Haz, 2016 1 kayıt (commit)
  9. 08 Nis, 2016 1 kayıt (commit)
  10. 10 Şub, 2016 1 kayıt (commit)
  11. 10 Eki, 2015 1 kayıt (commit)
  12. 28 Haz, 2015 1 kayıt (commit)
  13. 22 May, 2015 1 kayıt (commit)
  14. 09 May, 2015 1 kayıt (commit)
  15. 28 Kas, 2014 1 kayıt (commit)
  16. 24 Ock, 2014 1 kayıt (commit)
  17. 22 Ock, 2014 1 kayıt (commit)
  18. 03 Kas, 2013 1 kayıt (commit)
  19. 26 Eki, 2013 3 kayıt (commit)
  20. 19 Eki, 2013 1 kayıt (commit)
    • Nick Coghlan's avatar
      contextlib doc updates and refactoring · 8608d26e
      Nick Coghlan yazdı
      - explain single use, reusable and reentrant in docs
      - converted suppress to a reentrant class based impl
      - converted redirect_stdout to a reusable impl
      - moved both suppress and redirect_stdout behind a functional
        facade
      - added reentrancy tests for the updated suppress
      - added reusability tests for the updated redirect_stdio
      - slightly cleaned up an exception from contextmanager
      8608d26e
  21. 17 Eki, 2013 1 kayıt (commit)
  22. 11 Eki, 2013 1 kayıt (commit)
  23. 10 Eki, 2013 1 kayıt (commit)
  24. 01 Eki, 2013 1 kayıt (commit)
  25. 13 Haz, 2013 1 kayıt (commit)
  26. 11 Mar, 2013 1 kayıt (commit)
  27. 01 Haz, 2012 1 kayıt (commit)
  28. 31 May, 2012 2 kayıt (commit)
  29. 21 May, 2012 1 kayıt (commit)
  30. 05 May, 2011 1 kayıt (commit)
  31. 01 Ara, 2010 1 kayıt (commit)
  32. 02 Agu, 2010 1 kayıt (commit)
  33. 30 Haz, 2010 1 kayıt (commit)
  34. 28 Nis, 2010 1 kayıt (commit)
    • Victor Stinner's avatar
      Merged revisions 80552-80556,80564-80566,80568-80571 via svnmerge from · 45df8205
      Victor Stinner yazdı
      svn+ssh://pythondev@svn.python.org/python/trunk
      
      ........
        r80552 | victor.stinner | 2010-04-27 23:46:03 +0200 (mar., 27 avril 2010) | 3 lines
      
        Issue #7449, part 1: fix test_support.py for Python compiled without thread
      ........
        r80553 | victor.stinner | 2010-04-27 23:47:01 +0200 (mar., 27 avril 2010) | 1 line
      
        Issue #7449, part 2: regrtest.py -j option requires thread support
      ........
        r80554 | victor.stinner | 2010-04-27 23:51:26 +0200 (mar., 27 avril 2010) | 9 lines
      
        Issue #7449 part 3, test_doctest: import trace module in test_coverage()
      
        Import trace module fail if the threading module is missing. test_coverage() is
        only used if test_doctest.py is used with the -c option. This commit allows to
        execute the test suite without thread support.
      
        Move "import trace" in test_coverage() and use
        test_support.import_module('trace').
      ........
        r80555 | victor.stinner | 2010-04-27 23:56:26 +0200 (mar., 27 avril 2010) | 6 lines
      
        Issue #7449, part 4: skip test_multiprocessing if thread support is disabled
      
        import threading after _multiprocessing to raise a more revelant error message:
        "No module named _multiprocessing". _multiprocessing is not compiled without
        thread support.
      ........
        r80556 | victor.stinner | 2010-04-28 00:01:24 +0200 (mer., 28 avril 2010) | 8 lines
      
        Issue #7449, part 5: split Test.test_open() of ctypes/test/test_errno.py
      
         * Split Test.test_open() in 2 functions: test_open() and test_thread_open()
         * Skip test_open() and test_thread_open() if we are unable to find the C
           library
         * Skip test_thread_open() if thread support is disabled
         * Use unittest.skipUnless(os.name == "nt", ...) on test_GetLastError()
      ........
        r80564 | victor.stinner | 2010-04-28 00:59:35 +0200 (mer., 28 avril 2010) | 4 lines
      
        Issue #7449, part 6: fix test_hashlib for missing threading module
      
        Move @test_support.reap_thread decorator from test_main() to test_threaded_hashing().
      ........
        r80565 | victor.stinner | 2010-04-28 01:01:29 +0200 (mer., 28 avril 2010) | 6 lines
      
        Issue #7449, part 7: simplify threading detection in test_capi
      
         * Skip TestPendingCalls if threading module is missing
         * Test if threading module is present or not, instead of test the presence of
           _testcapi._test_thread_state
      ........
        r80566 | victor.stinner | 2010-04-28 01:03:16 +0200 (mer., 28 avril 2010) | 4 lines
      
        Issue #7449, part 8: don't skip the whole test_asynchat if threading is missing
      
        TestFifo can be executed without the threading module
      ........
        r80568 | victor.stinner | 2010-04-28 01:14:58 +0200 (mer., 28 avril 2010) | 6 lines
      
        Issue #7449, part 9: fix test_xmlrpclib for missing threading module
      
         * Skip testcases using threads if threading module is missing
         * Use "http://" instead of URL in ServerProxyTestCase if threading is missing
           because URL is not set in this case
      ........
        r80569 | victor.stinner | 2010-04-28 01:33:58 +0200 (mer., 28 avril 2010) | 6 lines
      
        Partial revert of r80556 (Issue #7449, part 5, fix ctypes test)
      
        Rewrite r80556: the thread test have to be executed just after the test on
        libc_open() and so the test cannot be splitted in two functions (without
        duplicating code, and I don't want to duplicate code).
      ........
        r80570 | victor.stinner | 2010-04-28 01:51:16 +0200 (mer., 28 avril 2010) | 8 lines
      
        Issue #7449, part 10: test_cmd imports trace module using test_support.import_module()
      
        Use test_support.import_module() instead of import to raise a SkipTest
        exception if the import fail. Import trace fails if the threading module is
        missing.
      
        See also part 3: test_doctest: import trace module in test_coverage().
      ........
        r80571 | victor.stinner | 2010-04-28 01:55:59 +0200 (mer., 28 avril 2010) | 6 lines
      
        Issue #7449, last part (11): fix many tests if thread support is disabled
      
         * Use try/except ImportError or test_support.import_module() to import thread
           and threading modules
         * Add @unittest.skipUnless(threading, ...) to testcases using threads
      ........
      45df8205
  35. 27 Nis, 2010 1 kayıt (commit)
  36. 02 Nis, 2010 1 kayıt (commit)
    • Florent Xicluna's avatar
      (partially) · 41fe6155
      Florent Xicluna yazdı
      Merged revisions 79534,79537,79539,79558,79606 via svnmerge from
      svn+ssh://pythondev@svn.python.org/python/trunk
      
      ........
        r79534 | florent.xicluna | 2010-03-31 23:21:54 +0200 (mer, 31 mar 2010) | 2 lines
      
        Fix test for xml.etree when using a non-ascii path.  And use check_warnings instead of catch_warnings.
      ........
        r79537 | florent.xicluna | 2010-03-31 23:40:32 +0200 (mer, 31 mar 2010) | 2 lines
      
        Fix typo
      ........
        r79539 | florent.xicluna | 2010-04-01 00:01:03 +0200 (jeu, 01 avr 2010) | 2 lines
      
        Replace catch_warnings with check_warnings when it makes sense.  Use assertRaises context manager to simplify some tests.
      ........
        r79558 | florent.xicluna | 2010-04-01 20:17:09 +0200 (jeu, 01 avr 2010) | 2 lines
      
        #7092: Fix some -3 warnings, and fix Lib/platform.py when the path contains a double-quote.
      ........
        r79606 | florent.xicluna | 2010-04-02 19:26:42 +0200 (ven, 02 avr 2010) | 2 lines
      
        Backport some robotparser test and skip the test if the external resource is not available.
      ........
      41fe6155
  37. 31 Mar, 2010 1 kayıt (commit)