Re: [PATCH] Makefile: Remove usage of deprecated Python "has_key" method

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Mar 28, 2010 at 09:38:54AM -0700, Junio C Hamano wrote:
> David Aguilar <davvid@xxxxxxxxx> writes:
> 
> > "has_key" is a deprecated dictionary method in Python 2.6+.
> > Simplify the sys.path manipulation for installed scripts by
> > passing a default value to os.getenv().
> 
> It looks like the old code was replacing sys.path[0] but you are
> prepending this.  Doesn't that change also make a difference?

The original code replaced sys.path[0] which is ''
(aka the current directory).  It's a little odd to
rely on the 0th element being something that is safe
to remove.

By prepending the path we have the same intended effect without
having to know that the 0th element is something that is
safe to remove.

Does removing '' break relative imports? (It might...)

Due to the portability concerns with relative imports the
recommendation is to always use absolute imports.  Thus, this
shouldn't hurt us in practice if we stick to absolute imports,
but I figured I'd mention it as another reason why prepending
might be preferred over replacing.

-- 
		David
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]