Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@4366 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
7 changed files with 90 additions and 2 deletions
@ -0,0 +1,19 @@ |
|||||||
|
##################################################################################### |
||||||
|
# |
||||||
|
# Copyright (c) Microsoft Corporation. All rights reserved. |
||||||
|
# |
||||||
|
# This source code is subject to terms and conditions of the Microsoft Public License. A |
||||||
|
# copy of the license can be found in the License.html file at the root of this distribution. If |
||||||
|
# you cannot locate the Microsoft Public License, please send an email to |
||||||
|
# ironpy@microsoft.com. By using this source code in any fashion, you are agreeing to be bound |
||||||
|
# by the terms of the Microsoft Public License. |
||||||
|
# |
||||||
|
# You must not remove this notice, or any other, from this software. |
||||||
|
# |
||||||
|
# |
||||||
|
##################################################################################### |
||||||
|
|
||||||
|
division=1 |
||||||
|
with_statement=1 |
||||||
|
generators=1 |
||||||
|
absolute_import=1 |
@ -0,0 +1,31 @@ |
|||||||
|
##################################################################################### |
||||||
|
# |
||||||
|
# Copyright (c) Microsoft Corporation. All rights reserved. |
||||||
|
# |
||||||
|
# This source code is subject to terms and conditions of the Microsoft Public License. A |
||||||
|
# copy of the license can be found in the License.html file at the root of this distribution. If |
||||||
|
# you cannot locate the Microsoft Public License, please send an email to |
||||||
|
# ironpy@microsoft.com. By using this source code in any fashion, you are agreeing to be bound |
||||||
|
# by the terms of the Microsoft Public License. |
||||||
|
# |
||||||
|
# You must not remove this notice, or any other, from this software. |
||||||
|
# |
||||||
|
# |
||||||
|
##################################################################################### |
||||||
|
|
||||||
|
""" |
||||||
|
Fake runpy.py which emulates what CPython does to properly support the '-m' flag. |
||||||
|
If you have access to the CPython standard library, you most likely do not need this. |
||||||
|
""" |
||||||
|
|
||||||
|
import sys, nt |
||||||
|
|
||||||
|
def run_module(modToRun, init_globals=None, run_name = '__main__', alter_sys = True): |
||||||
|
if alter_sys: |
||||||
|
for o in sys.path: |
||||||
|
libpath = o + '\\' + modToRun + '.py' |
||||||
|
if nt.access(libpath, nt.F_OK): |
||||||
|
sys.argv[0] = libpath |
||||||
|
break |
||||||
|
|
||||||
|
__import__(modToRun) |
@ -0,0 +1,14 @@ |
|||||||
|
##################################################################################### |
||||||
|
# |
||||||
|
# Copyright (c) Microsoft Corporation. All rights reserved. |
||||||
|
# |
||||||
|
# This source code is subject to terms and conditions of the Microsoft Public License. A |
||||||
|
# copy of the license can be found in the License.html file at the root of this distribution. If |
||||||
|
# you cannot locate the Microsoft Public License, please send an email to |
||||||
|
# ironpy@microsoft.com. By using this source code in any fashion, you are agreeing to be bound |
||||||
|
# by the terms of the Microsoft Public License. |
||||||
|
# |
||||||
|
# You must not remove this notice, or any other, from this software. |
||||||
|
# |
||||||
|
# |
||||||
|
##################################################################################### |
Loading…
Reference in new issue