From 4207f2c4bb6f6eb19e63407dcfdee876e42b6616 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Tue, 19 Dec 2023 10:15:34 +0800 Subject: [PATCH] bugfix --- ahserver/filetest.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ahserver/filetest.py b/ahserver/filetest.py index 1ca9f12..ed95874 100644 --- a/ahserver/filetest.py +++ b/ahserver/filetest.py @@ -1,8 +1,12 @@ import os def current_fileno(): - with open(__file__, 'r') as f: - return f.fileno() + fn = './t.txt' + f = open(fn, 'w') + ret = f.fileno() + f.close() + os.remove(fn) + return ret if __name__ == '__main__': for i in range(1000):