Commits

Amaury Forgeot d'Arc committed 2ad1a5d

Add ResourceWarning. Not used yet, but now "import warnings" passes!

  • Participants
  • Parent commits 9d18583
  • Branches py3k

Comments (0)

Files changed (2)

pypy/module/exceptions/__init__.py

         'BufferError' : 'interp_exceptions.W_BufferError',
         'BytesWarning'  : 'interp_exceptions.W_BytesWarning',
         'DeprecationWarning' : 'interp_exceptions.W_DeprecationWarning',
+        'ResourceWarning'  : 'interp_exceptions.W_ResourceWarning',
         'EOFError' : 'interp_exceptions.W_EOFError',
         'EnvironmentError' : 'interp_exceptions.W_EnvironmentError',
         'Exception' : 'interp_exceptions.W_Exception',

pypy/module/exceptions/interp_exceptions.py

            +-- ImportWarning
            +-- UnicodeWarning
            +-- BytesWarning
+           +-- ResourceWarning
 """
 
 from pypy.interpreter.baseobjspace import Wrappable
 W_DeprecationWarning = _new_exception('DeprecationWarning', W_Warning,
                         """Base class for warnings about deprecated features.""")
 
+W_ResourceWarning = _new_exception('ResourceWarning', W_Warning,
+         """Base class for warnings about resource usage.""")
+
 W_ArithmeticError = _new_exception('ArithmeticError', W_StandardError,
                          """Base class for arithmetic errors.""")