Project

General

Profile

« Previous | Next » 

Revision 2953

sql_gen.py: ensure_not_null(): Warn of no null sentinel for type, even if caller catches error

View differences:

sql_gen.py
4 4
import operator
5 5
import re
6 6
import UserDict
7
import warnings
7 8

  
8 9
import dicts
10
import exc
9 11
import iters
10 12
import lists
11 13
import objects
......
616 618
        if type_ == None: type_ = typed_col.type
617 619
        nullable = typed_col.nullable
618 620
    
619
    if nullable: col = EnsureNotNull(col, type_)
621
    if nullable:
622
        try: col = EnsureNotNull(col, type_)
623
        except KeyError, e:
624
            # Warn of no null sentinel for type, even if caller catches error
625
            warnings.warn(UserWarning(exc.str_(e)))
626
            raise
627
    
620 628
    return col

Also available in: Unified diff