void-packages/srcpkgs/python3-mygpoclient/patches/python3-fix-comparison-with-literal.patch
Đoàn Trần Công Danh 49cb564d14 srcpkgs/p*: convert patches to -Np1
* par is kept at -Np0

```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.-][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.-][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

37 lines
1.4 KiB
Diff

upstream: yes
From bdf8c8ce38cff8938bab3544c6dbb0d509ce7720 Mon Sep 17 00:00:00 2001
From: Eric Le Lay <elelay@macports.org>
Date: Sun, 22 Mar 2020 16:19:08 +0100
Subject: [PATCH] use == for comparison with literal
See https://bugs.python.org/issue34850
---
mygpoclient/locator.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/mygpoclient/locator.py b/mygpoclient/locator.py
index c0dc9d7..810f973 100644
--- a/mygpoclient/locator.py
+++ b/mygpoclient/locator.py
@@ -317,17 +317,17 @@ def settings_uri(self, type, scope_param1, scope_param2):
filename = self._username + '/%(type)s.json' % locals()
- if type is 'device':
+ if type == 'device':
if scope_param1 is None:
raise ValueError('Devicename not specified')
filename += '?device=%(scope_param1)s' % locals()
- if type is 'podcast':
+ if type == 'podcast':
if scope_param1 is None:
raise ValueError('Podcast URL not specified')
filename += '?podcast=%s' % quote(scope_param1)
- if type is 'episode':
+ if type == 'episode':
if (scope_param1 is None) or (scope_param2 is None):
raise ValueError('Podcast or Episode URL not specified')
filename += '?podcast=%s&episode=%s' % (quote(scope_param1), quote(scope_param2))