Let $ X $ to be a complex CW (possibly a topological / smooth variety) of dimension $ n $, $ L to X $ a complex bundle of lines and $ Y subset X $ a sub-complex (possibly a submultiple) contained in the codimension 3 skeleton of $ X $, such as $ L $ is trivial about $ X-Y $. Is it true in this case that $ L $ is trivial about the whole $ X $?

This obviously applies to the linear holomorphic bundles of smooth manifolds, in which case this corresponds to the complex codimension 2, but I would like to be able to replace holomorphic by smooth or continuous.