mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-26 02:43:43 +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
2e3833f7fb
commit
bc70902ea5
|
@ -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