mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-22 17:06:33 +03:00
Use bytestrings in infinite dates adapter example
Returning strings would result in unclear tracebacks on Py3 (see ticket #163).
This commit is contained in:
parent
8d8cc38590
commit
58c53025d1
|
@ -554,9 +554,9 @@ to map `date.max` to :sql:`infinity`, for instance::
|
|||
self.wrapped = wrapped
|
||||
def getquoted(self):
|
||||
if self.wrapped == datetime.date.max:
|
||||
return "'infinity'::date"
|
||||
return b"'infinity'::date"
|
||||
elif self.wrapped == datetime.date.min:
|
||||
return "'-infinity'::date"
|
||||
return b"'-infinity'::date"
|
||||
else:
|
||||
return psycopg2.extensions.DateFromPy(self.wrapped).getquoted()
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user