def test_debug_assignment(self):
    self.assertRaises(SyntaxError, compile, '__debug__ = 1', '?', 'single')
    import builtins
    prev = builtins.__debug__
    setattr(builtins, '__debug__', 'sure')
    self.assertEqual(__debug__, prev)
    setattr(builtins, '__debug__', prev)
def test_debug_assignment(self):
    self.assertRaises(SyntaxError, compile, '__debug__ = 1', '?', 'single')
    import builtins
    prev = builtins.__debug__
    setattr(builtins, '__debug__', 'sure')
    self.assertEqual(__debug__, prev)
    setattr(builtins, '__debug__', prev)