@@ -766,13 +766,15 @@ def docmodule(self, object, name=None, mod=None, *ignored):
766
766
except TypeError :
767
767
filelink = '(built-in)'
768
768
info = []
769
- if hasattr (object , '__version__' ):
770
- version = str (object .__version__ )
771
- if version [:11 ] == '$' + 'Revision: ' and version [- 1 :] == '$' :
772
- version = version [11 :- 1 ].strip ()
773
- info .append ('version %s' % self .escape (version ))
774
- if hasattr (object , '__date__' ):
775
- info .append (self .escape (str (object .__date__ )))
769
+ with warnings .catch_warnings ():
770
+ warnings .simplefilter ("ignore" , DeprecationWarning )
771
+ if hasattr (object , '__version__' ):
772
+ version = str (object .__version__ )
773
+ if version [:11 ] == '$' + 'Revision: ' and version [- 1 :] == '$' :
774
+ version = version [11 :- 1 ].strip ()
775
+ info .append ('version %s' % self .escape (version ))
776
+ if hasattr (object , '__date__' ):
777
+ info .append (self .escape (str (object .__date__ )))
776
778
if info :
777
779
head = head + ' (%s)' % ', ' .join (info )
778
780
docloc = self .getdocloc (object )
@@ -852,12 +854,14 @@ def docmodule(self, object, name=None, mod=None, *ignored):
852
854
contents .append (self .document (value , key ))
853
855
result = result + self .bigsection (
854
856
'Data' , 'data' , '<br>\n ' .join (contents ))
855
- if hasattr (object , '__author__' ):
856
- contents = self .markup (str (object .__author__ ), self .preformat )
857
- result = result + self .bigsection ('Author' , 'author' , contents )
858
- if hasattr (object , '__credits__' ):
859
- contents = self .markup (str (object .__credits__ ), self .preformat )
860
- result = result + self .bigsection ('Credits' , 'credits' , contents )
857
+ with warnings .catch_warnings ():
858
+ warnings .simplefilter ("ignore" , DeprecationWarning )
859
+ if hasattr (object , '__author__' ):
860
+ contents = self .markup (str (object .__author__ ), self .preformat )
861
+ result = result + self .bigsection ('Author' , 'author' , contents )
862
+ if hasattr (object , '__credits__' ):
863
+ contents = self .markup (str (object .__credits__ ), self .preformat )
864
+ result = result + self .bigsection ('Credits' , 'credits' , contents )
861
865
862
866
return result
863
867
@@ -1286,17 +1290,19 @@ def docmodule(self, object, name=None, mod=None):
1286
1290
contents .append (self .docother (value , key , name , maxlen = 70 ))
1287
1291
result = result + self .section ('DATA' , '\n ' .join (contents ))
1288
1292
1289
- if hasattr (object , '__version__' ):
1290
- version = str (object .__version__ )
1291
- if version [:11 ] == '$' + 'Revision: ' and version [- 1 :] == '$' :
1292
- version = version [11 :- 1 ].strip ()
1293
- result = result + self .section ('VERSION' , version )
1294
- if hasattr (object , '__date__' ):
1295
- result = result + self .section ('DATE' , str (object .__date__ ))
1296
- if hasattr (object , '__author__' ):
1297
- result = result + self .section ('AUTHOR' , str (object .__author__ ))
1298
- if hasattr (object , '__credits__' ):
1299
- result = result + self .section ('CREDITS' , str (object .__credits__ ))
1293
+ with warnings .catch_warnings ():
1294
+ warnings .simplefilter ("ignore" , DeprecationWarning )
1295
+ if hasattr (object , '__version__' ):
1296
+ version = str (object .__version__ )
1297
+ if version [:11 ] == '$' + 'Revision: ' and version [- 1 :] == '$' :
1298
+ version = version [11 :- 1 ].strip ()
1299
+ result = result + self .section ('VERSION' , version )
1300
+ if hasattr (object , '__date__' ):
1301
+ result = result + self .section ('DATE' , str (object .__date__ ))
1302
+ if hasattr (object , '__author__' ):
1303
+ result = result + self .section ('AUTHOR' , str (object .__author__ ))
1304
+ if hasattr (object , '__credits__' ):
1305
+ result = result + self .section ('CREDITS' , str (object .__credits__ ))
1300
1306
try :
1301
1307
file = inspect .getabsfile (object )
1302
1308
except TypeError :
0 commit comments