We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 99cf733 commit d26b18cCopy full SHA for d26b18c
pandas/io/clipboard/__init__.py
@@ -270,14 +270,12 @@ def copy_dev_clipboard(text):
270
if "\r" in text:
271
warnings.warn("Pyperclip cannot handle \\r characters on Cygwin.")
272
273
- fo = open("/dev/clipboard", "wt")
274
- fo.write(text)
275
- fo.close()
+ with open("/dev/clipboard", "wt") as fo:
+ fo.write(text)
276
277
def paste_dev_clipboard():
278
- fo = open("/dev/clipboard", "rt")
279
- content = fo.read()
280
+ with open("/dev/clipboard", "rt") as fo:
+ content = fo.read()
281
return content
282
283
return copy_dev_clipboard, paste_dev_clipboard
0 commit comments