Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cf6905f

Browse files
committed
Clarify the example by explicitly importing the fcntl module -- this
avoid being fooled into thinking that fcntl and FCNTL are the same thing -- they aren't! (fcntl is the extension, FCNTL.py is h2py output that defines all the constants). (XXX The example is still weird -- I think there's a more portable way to do locking now. That's for someone else to fix...)
1 parent 336a201 commit cf6905f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Doc/lib/libfcntl.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ \section{\module{fcntl} ---
6363
Examples (all on a SVR4 compliant system):
6464

6565
\begin{verbatim}
66-
import struct, FCNTL
66+
import struct, fcntl, FCNTL
6767
6868
file = open(...)
6969
rv = fcntl(file.fileno(), FCNTL.O_NDELAY, 1)
7070
7171
lockdata = struct.pack('hhllhh', FCNTL.F_WRLCK, 0, 0, 0, 0, 0)
72-
rv = fcntl(file.fileno(), FCNTL.F_SETLKW, lockdata)
72+
rv = fcntl.fcntl(file.fileno(), FCNTL.F_SETLKW, lockdata)
7373
\end{verbatim}
7474

7575
Note that in the first example the return value variable \code{rv} will

0 commit comments

Comments
 (0)