File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -139,7 +139,7 @@ def pdfRepr(obj):
139139 # Floats. PDF does not have exponential notation (1.0e-10) so we
140140 # need to use %f with some precision. Perhaps the precision
141141 # should adapt to the magnitude of the number?
142- elif isinstance (obj , float ):
142+ elif isinstance (obj , ( float , np . floating ) ):
143143 if not np .isfinite (obj ):
144144 raise ValueError ("Can only output finite numbers in PDF" )
145145 r = ("%.10f" % obj ).encode ('ascii' )
@@ -151,7 +151,7 @@ def pdfRepr(obj):
151151 return [b'false' , b'true' ][obj ]
152152
153153 # Integers are written as such.
154- elif isinstance (obj , (int , long )):
154+ elif isinstance (obj , (int , long , np . integer )):
155155 return ("%d" % obj ).encode ('ascii' )
156156
157157 # Unicode strings are encoded in UTF-16BE with byte-order mark.
You can’t perform that action at this time.
0 commit comments