mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: use print() function in both Python 2 and Python 3 (#18395)
Legacy print statements are syntax errors in Python 3 but print() function works as expected in both Python 2 and Python 3. Old style exceptions are syntax errors in Python 3 but new style exceptions work as expected in both Python 2 and Python 3.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
from __future__ import print_function
|
||||
import errno
|
||||
import os
|
||||
import platform
|
||||
@@ -47,7 +48,8 @@ def get_env_var(name):
|
||||
# TODO Remove ATOM_SHELL_* fallback values
|
||||
value = os.environ.get('ATOM_SHELL_' + name, '')
|
||||
if value:
|
||||
print 'Warning: Use $ELECTRON_' + name + ' instead of $ATOM_SHELL_' + name
|
||||
print('Warning: Use $ELECTRON_' + name +
|
||||
' instead of $ATOM_SHELL_' + name)
|
||||
return value
|
||||
|
||||
|
||||
@@ -63,7 +65,7 @@ def s3_config():
|
||||
|
||||
|
||||
def enable_verbose_mode():
|
||||
print 'Running in verbose mode'
|
||||
print('Running in verbose mode')
|
||||
global verbose_mode
|
||||
verbose_mode = True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user