Skip to content

Commit 356d761

Browse files
committed
A shorter and more readable way of comparing python versions
in example scripts.
1 parent 36c0759 commit 356d761

File tree

17 files changed

+58
-58
lines changed

17 files changed

+58
-58
lines changed

cefpython/cef1/linux/binaries/pygtk_.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
if os.path.exists(libcef_so):
1010
# Import local module
1111
ctypes.CDLL(libcef_so, ctypes.RTLD_GLOBAL)
12-
if sys.hexversion >= 0x02070000 and sys.hexversion < 0x03000000:
12+
if 0x02070000 <= sys.hexversion < 0x03000000:
1313
import cefpython_py27 as cefpython
1414
else:
1515
raise Exception("Unsupported python version: %s" % sys.version)

cefpython/cef1/linux/binaries/wxpython.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
if os.path.exists(libcef_so):
1010
# Import local module
1111
ctypes.CDLL(libcef_so, ctypes.RTLD_GLOBAL)
12-
if sys.hexversion >= 0x02070000 and sys.hexversion < 0x03000000:
12+
if 0x02070000 <= sys.hexversion < 0x03000000:
1313
import cefpython_py27 as cefpython
1414
else:
1515
raise Exception("Unsupported python version: %s" % sys.version)

cefpython/cef1/windows/binaries/cefadvanced.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414

1515
import sys
1616
try:
17-
# Import local PYD file (portable zip).
18-
if sys.hexversion >= 0x02070000 and sys.hexversion < 0x03000000:
17+
# Import local module.
18+
if 0x02070000 <= sys.hexversion < 0x03000000:
1919
import cefpython_py27 as cefpython
20-
elif sys.hexversion >= 0x03000000 and sys.hexversion < 0x04000000:
20+
elif 0x03000000 <= sys.hexversion < 0x04000000:
2121
import cefpython_py32 as cefpython
2222
else:
2323
raise Exception("Unsupported python version: %s" % sys.version)
2424
except ImportError:
25-
# Import from package (installer).
25+
# Import from package.
2626
from cefpython1 import cefpython
2727

2828
import cefwindow

cefpython/cef1/windows/binaries/cefsimple.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77

88
import sys
99
try:
10-
# Import local PYD file (portable zip).
11-
if sys.hexversion >= 0x02070000 and sys.hexversion < 0x03000000:
10+
# Import local module.
11+
if 0x02070000 <= sys.hexversion < 0x03000000:
1212
import cefpython_py27 as cefpython
13-
elif sys.hexversion >= 0x03000000 and sys.hexversion < 0x04000000:
13+
elif 0x03000000 <= sys.hexversion < 0x04000000:
1414
import cefpython_py32 as cefpython
1515
else:
1616
raise Exception("Unsupported python version: %s" % sys.version)
1717
except ImportError:
18-
# Import from package (installer).
18+
# Import from package.
1919
from cefpython1 import cefpython
2020

2121
import cefwindow

cefpython/cef1/windows/binaries/cefwxpanel.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99

1010
import sys
1111
try:
12-
# Import local PYD file (portable zip).
13-
if sys.hexversion >= 0x02070000 and sys.hexversion < 0x03000000:
12+
# Import local module.
13+
if 0x02070000 <= sys.hexversion < 0x03000000:
1414
import cefpython_py27 as cefpython
15-
elif sys.hexversion >= 0x03000000 and sys.hexversion < 0x04000000:
15+
elif 0x03000000 <= sys.hexversion < 0x04000000:
1616
import cefpython_py32 as cefpython
1717
else:
1818
raise Exception("Unsupported python version: %s" % sys.version)
1919
except ImportError:
20-
# Import from package (installer).
20+
# Import from package.
2121
from cefpython1 import cefpython
2222

2323
import wx

cefpython/cef1/windows/binaries/panda3d_.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@
2424

2525
import sys
2626
try:
27-
# Import local PYD file (portable zip).
28-
if sys.hexversion >= 0x02070000 and sys.hexversion < 0x03000000:
27+
# Import local module.
28+
if 0x02070000 <= sys.hexversion < 0x03000000:
2929
import cefpython_py27 as cefpython
30-
elif sys.hexversion >= 0x03000000 and sys.hexversion < 0x04000000:
30+
elif 0x03000000 <= sys.hexversion < 0x04000000:
3131
import cefpython_py32 as cefpython
3232
else:
3333
raise Exception("Unsupported python version: %s" % sys.version)
3434
except ImportError:
35-
# Import from package (installer).
35+
# Import from package.
3636
from cefpython1 import cefpython
3737

3838
from pandac.PandaModules import loadPrcFileData

cefpython/cef1/windows/binaries/pygtk_.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66

77
import sys
88
try:
9-
# Import local PYD file (portable zip).
10-
if sys.hexversion >= 0x02070000 and sys.hexversion < 0x03000000:
9+
# Import local module.
10+
if 0x02070000 <= sys.hexversion < 0x03000000:
1111
import cefpython_py27 as cefpython
12-
elif sys.hexversion >= 0x03000000 and sys.hexversion < 0x04000000:
12+
elif 0x03000000 <= sys.hexversion < 0x04000000:
1313
import cefpython_py32 as cefpython
1414
else:
1515
raise Exception("Unsupported python version: %s" % sys.version)
1616
except ImportError:
17-
# Import from package (installer).
17+
# Import from package.
1818
from cefpython1 import cefpython
1919

2020
import pygtk

cefpython/cef1/windows/binaries/pyqt.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66

77
import sys
88
try:
9-
# Import local PYD file (portable zip).
10-
if sys.hexversion >= 0x02070000 and sys.hexversion < 0x03000000:
9+
# Import local module.
10+
if 0x02070000 <= sys.hexversion < 0x03000000:
1111
import cefpython_py27 as cefpython
12-
elif sys.hexversion >= 0x03000000 and sys.hexversion < 0x04000000:
12+
elif 0x03000000 <= sys.hexversion < 0x04000000:
1313
import cefpython_py32 as cefpython
1414
else:
1515
raise Exception("Unsupported python version: %s" % sys.version)
1616
except ImportError:
17-
# Import from package (installer).
17+
# Import from package.
1818
from cefpython1 import cefpython
1919

2020
from PyQt4 import QtGui

cefpython/cef1/windows/binaries/pyside.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66

77
import sys
88
try:
9-
# Import local PYD file (portable zip).
10-
if sys.hexversion >= 0x02070000 and sys.hexversion < 0x03000000:
9+
# Import local module.
10+
if 0x02070000 <= sys.hexversion < 0x03000000:
1111
import cefpython_py27 as cefpython
12-
elif sys.hexversion >= 0x03000000 and sys.hexversion < 0x04000000:
12+
elif 0x03000000 <= sys.hexversion < 0x04000000:
1313
import cefpython_py32 as cefpython
1414
else:
1515
raise Exception("Unsupported python version: %s" % sys.version)
1616
except ImportError:
17-
# Import from package (installer).
17+
# Import from package.
1818
from cefpython1 import cefpython
1919

2020
import PySide

cefpython/cef1/windows/binaries/wxpython.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66

77
import sys
88
try:
9-
# Import local PYD file (portable zip).
10-
if sys.hexversion >= 0x02070000 and sys.hexversion < 0x03000000:
9+
# Import local module.
10+
if 0x02070000 <= sys.hexversion < 0x03000000:
1111
import cefpython_py27 as cefpython
12-
elif sys.hexversion >= 0x03000000 and sys.hexversion < 0x04000000:
12+
elif 0x03000000 <= sys.hexversion < 0x04000000:
1313
import cefpython_py32 as cefpython
1414
else:
1515
raise Exception("Unsupported python version: %s" % sys.version)
1616
except ImportError:
17-
# Import from package (installer).
17+
# Import from package.
1818
from cefpython1 import cefpython
1919

2020
import wx

0 commit comments

Comments
 (0)