mirror of
				https://github.com/encode/django-rest-framework.git
				synced 2025-11-04 18:08:03 +03:00 
			
		
		
		
	Correct misspelled module 'typing' (#6616)
https://docs.python.org/3/library/typing.html
This commit is contained in:
		
							parent
							
								
									7f16ed7727
								
							
						
					
					
						commit
						1a0a8dde00
					
				| 
						 | 
					@ -19,9 +19,9 @@ from rest_framework.compat import ProhibitNullCharactersValidator
 | 
				
			||||||
from rest_framework.fields import DjangoImageField, is_simple_callable
 | 
					from rest_framework.fields import DjangoImageField, is_simple_callable
 | 
				
			||||||
 | 
					
 | 
				
			||||||
try:
 | 
					try:
 | 
				
			||||||
    import typings
 | 
					    import typing
 | 
				
			||||||
except ImportError:
 | 
					except ImportError:
 | 
				
			||||||
    typings = False
 | 
					    typing = False
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Tests for helper functions.
 | 
					# Tests for helper functions.
 | 
				
			||||||
| 
						 | 
					@ -93,11 +93,12 @@ class TestIsSimpleCallable:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        assert is_simple_callable(ChoiceModel().get_choice_field_display)
 | 
					        assert is_simple_callable(ChoiceModel().get_choice_field_display)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @unittest.skipUnless(typings, 'requires python 3.5')
 | 
					    @unittest.skipUnless(typing, 'requires python 3.5')
 | 
				
			||||||
    def test_type_annotation(self):
 | 
					    def test_type_annotation(self):
 | 
				
			||||||
        # The annotation will otherwise raise a syntax error in python < 3.5
 | 
					        # The annotation will otherwise raise a syntax error in python < 3.5
 | 
				
			||||||
        exec("def valid(param: str='value'):  pass", locals())
 | 
					        locals = {}
 | 
				
			||||||
        valid = locals()['valid']
 | 
					        exec("def valid(param: str='value'):  pass", locals)
 | 
				
			||||||
 | 
					        valid = locals['valid']
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        assert is_simple_callable(valid)
 | 
					        assert is_simple_callable(valid)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user