summaryrefslogtreecommitdiff
path: root/Examples/python
diff options
context:
space:
mode:
authorDmitry D. Chernov <blackdoomer@yandex.ru>2019-07-14 14:12:23 +1000
committerDmitry D. Chernov <blackdoomer@yandex.ru>2019-07-14 14:12:23 +1000
commitf88ba7c18250bce730e0caa5aa9e2a287acfa223 (patch)
tree7ae88f5fb637e3e4f0aa6890ac4c3a586151d3cc /Examples/python
parentfa5f519bf9842b523a12cab0bc20f836d8a8a903 (diff)
downloadswig-f88ba7c18250bce730e0caa5aa9e2a287acfa223.tar.gz
Examples: Unify string quoting in the Python sources
Diffstat (limited to 'Examples/python')
-rw-r--r--Examples/python/import_packages/namespace_pkg/normal.py2
-rw-r--r--Examples/python/import_packages/namespace_pkg/nstest.py16
-rw-r--r--Examples/python/import_packages/namespace_pkg/split.py4
-rw-r--r--Examples/python/import_packages/namespace_pkg/zipsplit.py4
-rw-r--r--Examples/python/performance/constructor/runme.py2
-rw-r--r--Examples/python/performance/func/runme.py2
-rw-r--r--Examples/python/performance/harness.py6
-rw-r--r--Examples/python/performance/hierarchy/runme.py2
-rw-r--r--Examples/python/performance/hierarchy_operator/runme.py2
-rw-r--r--Examples/python/performance/operator/runme.py2
10 files changed, 21 insertions, 21 deletions
diff --git a/Examples/python/import_packages/namespace_pkg/normal.py b/Examples/python/import_packages/namespace_pkg/normal.py
index 924142f74..0eb8f517c 100644
--- a/Examples/python/import_packages/namespace_pkg/normal.py
+++ b/Examples/python/import_packages/namespace_pkg/normal.py
@@ -11,7 +11,7 @@ def run_except_on_windows(commandline, env=None):
print(" Starting subtest " + os.path.basename(__file__))
# Package brave found under one path
-sys.path.insert(0, 'path1')
+sys.path.insert(0, "path1")
from brave import robin
print(" Finished from brave import robin")
diff --git a/Examples/python/import_packages/namespace_pkg/nstest.py b/Examples/python/import_packages/namespace_pkg/nstest.py
index e80289fb1..4d618a6ad 100644
--- a/Examples/python/import_packages/namespace_pkg/nstest.py
+++ b/Examples/python/import_packages/namespace_pkg/nstest.py
@@ -11,7 +11,7 @@ def run_except_on_windows(commandline, env=None):
print(" Finished running: " + commandline)
def copyMods():
- dirs = ['path1', 'path2', 'path3']
+ dirs = ["path1", "path2", "path3"]
# Clean out any old package paths
for d in dirs:
@@ -20,20 +20,20 @@ def copyMods():
for d in dirs:
os.mkdir(d)
- os.mkdir(os.path.join(d, 'brave'))
+ os.mkdir(os.path.join(d, "brave"))
- shutil.copy('robin.py', os.path.join('path1', 'brave'))
- subprocess.check_call('cp _robin.* ' + os.path.join('path1', 'brave'), shell=True)
+ shutil.copy("robin.py", os.path.join("path1", "brave"))
+ subprocess.check_call("cp _robin.* " + os.path.join("path1", "brave"), shell=True)
- shutil.copy('robin.py', os.path.join('path2', 'brave'))
- subprocess.check_call('cp _robin.* ' + os.path.join('path3', 'brave'), shell=True)
+ shutil.copy("robin.py", os.path.join("path2", "brave"))
+ subprocess.check_call("cp _robin.* " + os.path.join("path3", "brave"), shell=True)
mkzip()
def mkzip():
zf = zipfile.ZipFile("path4.zip", "w")
- zf.writestr("brave/", b'')
- zf.write('robin.py', 'brave/robin.py')
+ zf.writestr("brave/", b"")
+ zf.write("robin.py", "brave/robin.py")
zf.close()
diff --git a/Examples/python/import_packages/namespace_pkg/split.py b/Examples/python/import_packages/namespace_pkg/split.py
index 8989954cc..9d786dc07 100644
--- a/Examples/python/import_packages/namespace_pkg/split.py
+++ b/Examples/python/import_packages/namespace_pkg/split.py
@@ -12,8 +12,8 @@ print(" Starting subtest " + os.path.basename(__file__))
# Package brave split into two paths.
# path2/brave/robin.py and path3/brave/_robin.so
-sys.path.insert(0, 'path2')
-sys.path.insert(0, 'path3')
+sys.path.insert(0, "path2")
+sys.path.insert(0, "path3")
from brave import robin
print(" Finished from brave import robin")
diff --git a/Examples/python/import_packages/namespace_pkg/zipsplit.py b/Examples/python/import_packages/namespace_pkg/zipsplit.py
index 8af9cf025..30434f9c0 100644
--- a/Examples/python/import_packages/namespace_pkg/zipsplit.py
+++ b/Examples/python/import_packages/namespace_pkg/zipsplit.py
@@ -12,8 +12,8 @@ print(" Starting subtest " + os.path.basename(__file__))
# Package brave split into two paths.
# brave/robin.py (in path4.zip) and path3/brave/_robin.so
-sys.path.insert(0, 'path4.zip')
-sys.path.insert(0, 'path3')
+sys.path.insert(0, "path4.zip")
+sys.path.insert(0, "path3")
from brave import robin
print(" Finished from brave import robin")
diff --git a/Examples/python/performance/constructor/runme.py b/Examples/python/performance/constructor/runme.py
index 1771fba7b..b00cd456c 100644
--- a/Examples/python/performance/constructor/runme.py
+++ b/Examples/python/performance/constructor/runme.py
@@ -1,5 +1,5 @@
import sys
-sys.path.append('..')
+sys.path.append("..")
import harness
diff --git a/Examples/python/performance/func/runme.py b/Examples/python/performance/func/runme.py
index 760a8ab6d..3b142791c 100644
--- a/Examples/python/performance/func/runme.py
+++ b/Examples/python/performance/func/runme.py
@@ -1,5 +1,5 @@
import sys
-sys.path.append('..')
+sys.path.append("..")
import harness
diff --git a/Examples/python/performance/harness.py b/Examples/python/performance/harness.py
index c3d38b4fb..3468faaad 100644
--- a/Examples/python/performance/harness.py
+++ b/Examples/python/performance/harness.py
@@ -17,16 +17,16 @@ def run(proc):
except IndexError:
proc = Popen(
- [sys.executable, 'runme.py', 'Simple_baseline'], stdout=PIPE)
+ [sys.executable, "runme.py", "Simple_baseline"], stdout=PIPE)
(stdout, stderr) = proc.communicate()
print stdout
proc = Popen(
- [sys.executable, 'runme.py', 'Simple_optimized'], stdout=PIPE)
+ [sys.executable, "runme.py", "Simple_optimized"], stdout=PIPE)
(stdout, stderr) = proc.communicate()
print stdout
proc = Popen(
- [sys.executable, 'runme.py', 'Simple_builtin'], stdout=PIPE)
+ [sys.executable, "runme.py", "Simple_builtin"], stdout=PIPE)
(stdout, stderr) = proc.communicate()
print stdout
diff --git a/Examples/python/performance/hierarchy/runme.py b/Examples/python/performance/hierarchy/runme.py
index 8255cdc86..389958284 100644
--- a/Examples/python/performance/hierarchy/runme.py
+++ b/Examples/python/performance/hierarchy/runme.py
@@ -1,5 +1,5 @@
import sys
-sys.path.append('..')
+sys.path.append("..")
import harness
diff --git a/Examples/python/performance/hierarchy_operator/runme.py b/Examples/python/performance/hierarchy_operator/runme.py
index eabfae864..48241d48b 100644
--- a/Examples/python/performance/hierarchy_operator/runme.py
+++ b/Examples/python/performance/hierarchy_operator/runme.py
@@ -1,5 +1,5 @@
import sys
-sys.path.append('..')
+sys.path.append("..")
import harness
diff --git a/Examples/python/performance/operator/runme.py b/Examples/python/performance/operator/runme.py
index d75ae404c..798dd8bf9 100644
--- a/Examples/python/performance/operator/runme.py
+++ b/Examples/python/performance/operator/runme.py
@@ -1,5 +1,5 @@
import sys
-sys.path.append('..')
+sys.path.append("..")
import harness