archrelease: copy trunk to extra-x86_64
[arch-packages.git] / python-cffi / trunk / python-cffi-remove-py-usage.patch
blob350cd723e7d7b768c80be66b459590333206d346
1 From 9c7d865e17ec16a847090a3e0d1498b698b99756 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
3 Date: Mon, 14 Nov 2022 12:30:12 +0100
4 Subject: [PATCH] Drop py.code usage from tests, no longer depend on the
5 deprecated py package
7 --HG--
8 branch : py.code
9 ---
10 README.md | 2 +-
11 requirements.txt | 1 -
12 testing/cffi0/test_zintegration.py | 3 ++-
13 testing/cffi1/test_dlopen_unicode_literals.py | 4 ++--
14 4 files changed, 5 insertions(+), 5 deletions(-)
16 diff --git a/testing/cffi0/test_zintegration.py b/testing/cffi0/test_zintegration.py
17 index d6a02ce0..ca2d4642 100644
18 --- a/testing/cffi0/test_zintegration.py
19 +++ b/testing/cffi0/test_zintegration.py
20 @@ -1,5 +1,6 @@
21 import py, os, sys, shutil
22 import subprocess
23 +import textwrap
24 from testing.udir import udir
25 import pytest
27 @@ -66,7 +67,7 @@ def really_run_setup_and_program(dirname, venv_dir_and_paths, python_snippet):
28 remove(os.path.join(basedir, '__pycache__'))
29 olddir = os.getcwd()
30 python_f = udir.join('x.py')
31 - python_f.write(py.code.Source(python_snippet))
32 + python_f.write(textwrap.dedent(python_snippet))
33 try:
34 os.chdir(str(SNIPPET_DIR.join(dirname)))
35 if os.name == 'nt':
36 diff --git a/testing/cffi1/test_dlopen_unicode_literals.py b/testing/cffi1/test_dlopen_unicode_literals.py
37 index e792866e..dc955a57 100644
38 --- a/testing/cffi1/test_dlopen_unicode_literals.py
39 +++ b/testing/cffi1/test_dlopen_unicode_literals.py
40 @@ -1,4 +1,4 @@
41 -import py, os
42 +import os
44 s = """from __future__ import unicode_literals
45 """
46 @@ -6,4 +6,4 @@ s = """from __future__ import unicode_literals
47 with open(os.path.join(os.path.dirname(__file__), 'test_dlopen.py')) as f:
48 s += f.read()
50 -exec(py.code.compile(s))
51 +exec(compile(s, filename='test_dlopen.py', mode='exec'))
52 --
53 GitLab