Remove a couple Python 2 __nonzero__ definitions
It's called __bool__ in Python 3.
This commit is contained in:
		
							parent
							
								
									be68496440
								
							
						
					
					
						commit
						409ffcef17
					
				| 
						 | 
					@ -38,8 +38,6 @@ class MarkEvaluator:
 | 
				
			||||||
        # don't cache here to prevent staleness
 | 
					        # don't cache here to prevent staleness
 | 
				
			||||||
        return bool(self._get_marks())
 | 
					        return bool(self._get_marks())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    __nonzero__ = __bool__
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    def wasvalid(self):
 | 
					    def wasvalid(self):
 | 
				
			||||||
        return not hasattr(self, "exc")
 | 
					        return not hasattr(self, "exc")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -640,10 +640,10 @@ class TestAssertionRewrite:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        assert getmsg(f) == "assert 5 <= 4"
 | 
					        assert getmsg(f) == "assert 5 <= 4"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def test_assert_raising_nonzero_in_comparison(self):
 | 
					    def test_assert_raising__bool__in_comparison(self):
 | 
				
			||||||
        def f():
 | 
					        def f():
 | 
				
			||||||
            class A:
 | 
					            class A:
 | 
				
			||||||
                def __nonzero__(self):
 | 
					                def __bool__(self):
 | 
				
			||||||
                    raise ValueError(42)
 | 
					                    raise ValueError(42)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                def __lt__(self, other):
 | 
					                def __lt__(self, other):
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue