]> Cypherpunks repositories - keks.git/commitdiff
Use stdin
authorSergey Matveev <stargrave@stargrave.org>
Fri, 21 Feb 2025 13:00:13 +0000 (16:00 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Fri, 21 Feb 2025 14:41:21 +0000 (17:41 +0300)
py3/keks.py

index f00262e9e2f0cb1b46c2cd129562940f15bfe30da20db95c6bd81d29029518df..7675904f1dbf0cf36a26df38a2bed4fd8fca83ef529c6ad5c81b7f55423bf2d8 100755 (executable)
@@ -503,9 +503,9 @@ if __name__ == "__main__":
     parser.add_argument(
         "--leapsec-utc-allow", action="store_true",
         help="Allow leapseconded UTC values")
-    parser.add_argument("file", type=FileType("rb"))
     args = parser.parse_args()
-    data = args.file.read()
+    from sys import stdin
+    data = stdin.buffer.read()
     obj = Magic(b"")
     from pprint import pprint
     while isinstance(obj, Magic):