global: use defusedxml if it is available
This commit is contained in:
		
							
								
								
									
										1
									
								
								setup.py
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								setup.py
									
									
									
									
									
								
							@@ -87,6 +87,7 @@ setup(
 | 
			
		||||
    extras_require={
 | 
			
		||||
        'XEP-0363': ['aiohttp'],
 | 
			
		||||
        'XEP-0444 compliance': ['emoji'],
 | 
			
		||||
        'Safer XML parsing': ['defusedxml'],
 | 
			
		||||
    },
 | 
			
		||||
    classifiers=CLASSIFIERS,
 | 
			
		||||
    cmdclass={'test': TestCommand}
 | 
			
		||||
 
 | 
			
		||||
@@ -6,6 +6,13 @@
 | 
			
		||||
import logging
 | 
			
		||||
logging.getLogger(__name__).addHandler(logging.NullHandler())
 | 
			
		||||
 | 
			
		||||
# Use defusedxml if available
 | 
			
		||||
try:
 | 
			
		||||
    import defusedxml
 | 
			
		||||
    defusedxml.defuse_stdlib()
 | 
			
		||||
except ImportError:
 | 
			
		||||
    pass
 | 
			
		||||
 | 
			
		||||
from slixmpp.stanza import Message, Presence, Iq
 | 
			
		||||
from slixmpp.jid import JID, InvalidJID
 | 
			
		||||
from slixmpp.xmlstream.stanzabase import ET, ElementBase, register_stanza_plugin
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user