mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 07:31:38 +00:00 
			
		
		
		
	
							parent
							
								
									9305bba203
								
							
						
					
					
						commit
						702b0460d2
					
				
					 2 changed files with 8 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -145,7 +145,7 @@ def __init__(self, _factory=None, *, policy=compat32):
 | 
			
		|||
 | 
			
		||||
        """
 | 
			
		||||
        self.policy = policy
 | 
			
		||||
        self._factory_kwds = lambda: {'policy': self.policy}
 | 
			
		||||
        self._old_style_factory = False
 | 
			
		||||
        if _factory is None:
 | 
			
		||||
            # What this should be:
 | 
			
		||||
            #self._factory = policy.default_message_factory
 | 
			
		||||
| 
						 | 
				
			
			@ -160,7 +160,7 @@ def __init__(self, _factory=None, *, policy=compat32):
 | 
			
		|||
                _factory(policy=self.policy)
 | 
			
		||||
            except TypeError:
 | 
			
		||||
                # Assume this is an old-style factory
 | 
			
		||||
                self._factory_kwds = lambda: {}
 | 
			
		||||
                self._old_style_factory = True
 | 
			
		||||
        self._input = BufferedSubFile()
 | 
			
		||||
        self._msgstack = []
 | 
			
		||||
        self._parse = self._parsegen().__next__
 | 
			
		||||
| 
						 | 
				
			
			@ -197,7 +197,10 @@ def close(self):
 | 
			
		|||
        return root
 | 
			
		||||
 | 
			
		||||
    def _new_message(self):
 | 
			
		||||
        msg = self._factory(**self._factory_kwds())
 | 
			
		||||
        if self._old_style_factory:
 | 
			
		||||
            msg = self._factory()
 | 
			
		||||
        else:
 | 
			
		||||
            msg = self._factory(policy=self.policy)
 | 
			
		||||
        if self._cur and self._cur.get_content_type() == 'multipart/digest':
 | 
			
		||||
            msg.set_default_type('message/rfc822')
 | 
			
		||||
        if self._msgstack:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -24,6 +24,8 @@ Core and Builtins
 | 
			
		|||
Library
 | 
			
		||||
-------
 | 
			
		||||
 | 
			
		||||
- Issue #27522: Avoid an unintentional reference cycle in email.feedparser.
 | 
			
		||||
 | 
			
		||||
- Issue #26844: Fix error message for imp.find_module() to refer to 'path'
 | 
			
		||||
  instead of 'name'. Patch by Lev Maximov.
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue