File tree Expand file tree Collapse file tree 3 files changed +6
-4
lines changed
com.oracle.graal.python.shell/src/com/oracle/graal/python/shell
com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ language runtime. The main focus is on user-observable behavior of the engine.
5
5
6
6
## Version 20.1.1
7
7
* When a ` *.py ` file is imported, ` *.pyc ` file is created. It contains binary data to speed up parsing.
8
- * Adding option ` PyCachePrefix ` , which is equivalent to PYTHONPYCACHEPREFIX environment variable.
8
+ * Adding option ` PyCachePrefix ` , which is equivalent to PYTHONPYCACHEPREFIX environment variable, which is also accepted now .
9
9
* Adding optin ` DontWriteBytecodeFlag ` . Equivalent to the Python -B flag. Don't write bytecode files.
10
10
* Command option -B works
11
11
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ public static void main(String[] args) {
87
87
private List <String > relaunchArgs ;
88
88
private boolean wantsExperimental = false ;
89
89
private Map <String , String > enginePolyglotOptions ;
90
- private boolean dontWriteBytecode = ImageInfo . inImageBuildtimeCode () ;
90
+ private boolean dontWriteBytecode = false ;
91
91
92
92
@ Override
93
93
protected List <String > preprocessArguments (List <String > givenArgs , Map <String , String > polyglotOptions ) {
@@ -608,6 +608,8 @@ protected void printHelp(OptionCategory maxCategory) {
608
608
" as specifying the -R option: a random value is used to seed the hashes of\n " +
609
609
" str, bytes and datetime objects. It can also be set to an integer\n " +
610
610
" in the range [0,4294967295] to get hash values with a predictable seed.\n " +
611
+ "PYTHONPYCACHEPREFIX: if this is set, GraalPython will write .pyc files in a mirror\n " +
612
+ " directory tree at this path, instead of in __pycache__ directories within the source tree.\n " +
611
613
"GRAAL_PYTHON_ARGS: the value is added as arguments as if passed on the\n " +
612
614
" commandline. There is one special case: any `$$' in the value is replaced\n " +
613
615
" with the current process id. To pass a literal `$$', you must escape the\n " +
Original file line number Diff line number Diff line change @@ -192,13 +192,13 @@ public void postInitialize(PythonCore core) {
192
192
sys .setAttribute ("executable" , context .getOption (PythonOptions .Executable ));
193
193
sys .setAttribute ("_base_executable" , context .getOption (PythonOptions .Executable ));
194
194
}
195
- sys .setAttribute ("dont_write_bytecode" , context .getOption (PythonOptions .DontWriteBytecodeFlag ));
195
+ sys .setAttribute ("dont_write_bytecode" , ImageInfo . inImageBuildtimeCode () || context .getOption (PythonOptions .DontWriteBytecodeFlag ));
196
196
String pycachePrefix = context .getOption (PythonOptions .PyCachePrefix );
197
197
sys .setAttribute ("pycache_prefix" , pycachePrefix .isEmpty () ? PNone .NONE : pycachePrefix );
198
198
sys .setAttribute ("__flags__" , core .factory ().createTuple (new Object []{
199
199
false , // bytes_warning
200
200
!context .getOption (PythonOptions .PythonOptimizeFlag ), // debug
201
- context .getOption (PythonOptions .DontWriteBytecodeFlag ), // dont_write_bytecode
201
+ ImageInfo . inImageBuildtimeCode () || context .getOption (PythonOptions .DontWriteBytecodeFlag ), // dont_write_bytecode
202
202
false , // hash_randomization
203
203
context .getOption (PythonOptions .IgnoreEnvironmentFlag ), // ignore_environment
204
204
context .getOption (PythonOptions .InspectFlag ), // inspect
You can’t perform that action at this time.
0 commit comments