changed debian/source/format to native

This commit is contained in:
openKylinBot 2022-05-14 02:47:50 +08:00
parent 4689f513a6
commit 8156a133f1
3 changed files with 1 additions and 88 deletions

View File

@ -1,86 +0,0 @@
From: Ben Finney <bignose@debian.org>
Date: Sat, 14 May 2022 02:47:49 +0800
Subject: Make doctest examples compatible with Python 2 and Python 3.
Existing doctests were written only for Python 2 and have not yet
been updated upstream to work with Python 3.
Last-Update: 2015-05-16
---
doc/source/index.rst | 6 +++---
lockfile/__init__.py | 16 ++++++++--------
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/doc/source/index.rst b/doc/source/index.rst
index 5f1f2dd..ac1ba50 100644
--- a/doc/source/index.rst
+++ b/doc/source/index.rst
@@ -231,14 +231,14 @@ This example is the "hello world" for the :mod:`lockfile` package::
from lockfile import LockFile
lock = LockFile("/some/file/or/other")
with lock:
- print lock.path, 'is locked.'
+ print(lock.path, "is locked.")
To use this with Python 2.4, you can execute::
from lockfile import LockFile
lock = LockFile("/some/file/or/other")
lock.acquire()
- print lock.path, 'is locked.'
+ print(lock.path, "is locked.")
lock.release()
If you don't want to wait forever, you might try::
@@ -251,7 +251,7 @@ If you don't want to wait forever, you might try::
except LockTimeout:
lock.break_lock()
lock.acquire()
- print "I locked", lock.path
+ print("I locked", lock.path)
lock.release()
You can also insure that a lock is always held when appropriately decorated
diff --git a/lockfile/__init__.py b/lockfile/__init__.py
index a6f44a5..d4b1436 100644
--- a/lockfile/__init__.py
+++ b/lockfile/__init__.py
@@ -12,23 +12,23 @@ Usage:
>>> try:
... lock.acquire()
... except AlreadyLocked:
-... print 'somefile', 'is locked already.'
+... print('somefile', "is locked already.")
... except LockFailed:
-... print 'somefile', 'can\\'t be locked.'
+... print('somefile', "can't be locked.")
... else:
-... print 'got lock'
+... print("got lock")
got lock
->>> print lock.is_locked()
+>>> lock.is_locked()
True
>>> lock.release()
>>> lock = LockFile('somefile')
->>> print lock.is_locked()
+>>> lock.is_locked()
False
>>> with lock:
-... print lock.is_locked()
+... lock.is_locked()
True
->>> print lock.is_locked()
+>>> lock.is_locked()
False
>>> lock = LockFile('somefile')
@@ -37,7 +37,7 @@ False
... lock.acquire()
...
>>> # Though no counter is kept, so you can't unlock multiple times...
->>> print lock.is_locked()
+>>> lock.is_locked()
False
Exceptions:

View File

@ -1 +0,0 @@
001.doctests-compatible-py2and3.patch

View File

@ -1 +1 @@
3.0 (quilt)
3.0 (native)