arfrever_at_tigris.org wrote:
> Author: arfrever
> Date: Tue Jul 1 11:32:05 2008
> New Revision: 31953
>
> Log:
> On the 'ctypes-python-bindings' branch:
>
> * autogen.py: Search PATH for ctypesgen.
>
> Modified:
> branches/ctypes-python-bindings/autogen.py
>
> Modified: branches/ctypes-python-bindings/autogen.py
> URL: http://svn.collab.net/viewvc/svn/branches/ctypes-python-bindings/autogen.py?pathrev=31953&r1=31952&r2=31953
> ==============================================================================
> --- branches/ctypes-python-bindings/autogen.py Tue Jul 1 10:24:51 2008 (r31952)
> +++ branches/ctypes-python-bindings/autogen.py Tue Jul 1 11:32:05 2008 (r31953)
> @@ -157,7 +157,16 @@ def run_cmd(cmd):
> # Build csvn/core/functions.py
> ########################################################################
>
> -if not os.path.exists("ctypesgen"):
> +ctypesgen_basename = "wrap.py"
> +ctypesgen = ""
> +if os.path.exists("ctypesgen/" + ctypesgen_basename):
> + ctypesgen = os.getcwd() + "/ctypesgen/" + ctypesgen_basename
> +else:
> + for path in os.environ["PATH"].split(":"):
> + if os.path.exists(path + "/" + ctypesgen_basename):
> + ctypesgen = path + "/" + ctypesgen_basename
> + break
Wouldn't it be safer to use os.path.join() instead of string concatenation?
This is for non-Unix platforms.
Blair
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-07-01 20:35:59 CEST