PageRenderTime 76ms CodeModel.GetById 47ms RepoModel.GetById 1ms app.codeStats 0ms

/logilab-astng-0.23.1/test/regrtest_data/descriptor_crash.py

#
Python | 31 lines | 8 code | 3 blank | 20 comment | 0 complexity | a2e24e9f66f5179d7197af1b815acae1 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1
  1. # -*- coding: iso-8859-1 -*-
  2. # copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
  3. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
  4. # copyright 2003-2010 Sylvain Thenault, all rights reserved.
  5. # contact mailto:thenault@gmail.com
  6. #
  7. # This file is part of logilab-astng.
  8. #
  9. # logilab-astng is free software: you can redistribute it and/or modify it
  10. # under the terms of the GNU Lesser General Public License as published by the
  11. # Free Software Foundation, either version 2.1 of the License, or (at your
  12. # option) any later version.
  13. #
  14. # logilab-astng is distributed in the hope that it will be useful, but
  15. # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  16. # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
  17. # for more details.
  18. #
  19. # You should have received a copy of the GNU Lesser General Public License along
  20. # with logilab-astng. If not, see <http://www.gnu.org/licenses/>.
  21. import urllib
  22. class Page(object):
  23. _urlOpen = staticmethod(urllib.urlopen)
  24. def getPage(self, url):
  25. handle = self._urlOpen(url)
  26. data = handle.read()
  27. handle.close()
  28. return data