[Python-checkins] r51931 - sandbox/trunk/setuptools/doctest.py

Jim Jewett jimjjewett at gmail.com
Wed Sep 20 23:05:21 CEST 2006


On 9/20/06, phillip.eby <python-checkins at python.org> wrote:
> Author: phillip.eby
> Date: Wed Sep 20 22:20:57 2006
> New Revision: 51931
>
> Modified:
>    sandbox/trunk/setuptools/doctest.py
> Log:
> Retain 2.3/2.4 compatibility as well...

Please add that explanation to the code itself.

> Modified: sandbox/trunk/setuptools/doctest.py
> ==============================================================================
> --- sandbox/trunk/setuptools/doctest.py (original)
> +++ sandbox/trunk/setuptools/doctest.py Wed Sep 20 22:20:57 2006
> @@ -1333,8 +1333,10 @@
>          if m and m.group('name') == self.test.name:
>              example = self.test.examples[int(m.group('examplenum'))]
>              return example.source.splitlines(True)
> -        else:

             # if the linecache is new enough

> +        elif self.save_linecache_getlines.func_code.co_argcount>1:
>              return self.save_linecache_getlines(filename, module_globals)

             # 2.3, 2.4 compatibility

> +        else:
> +            return self.save_linecache_getlines(filename)
>
>      def run(self, test, compileflags=None, out=None, clear_globs=True):
>          """
> _______________________________________________
> Python-checkins mailing list
> Python-checkins at python.org
> http://mail.python.org/mailman/listinfo/python-checkins
>


More information about the Python-checkins mailing list